import os
import tkinter
from tkinter import ttk
import main
import json
import res_update
from PIL import Image,ImageTk
from shutil import copyfile
import windnd
from tkinter.messagebox import showinfo


class AutocompleteCombobox(ttk.Combobox):

    def set_completion_list(self, completion_list):
        """Use our completion list as our drop down selection menu, arrows move through menu."""
        self._completion_list = sorted(completion_list, key=str.lower)  # Work with a sorted list
        self._hits = []
        self._hit_index = 0
        self.position = 0
        self.bind('<KeyRelease>', self.handle_keyrelease)
        self['values'] = self._completion_list  # Setup our popup menu

    def autocomplete(self, delta=0):
        """autocomplete the Combobox, delta may be 0/1/-1 to cycle through possible hits"""
        if delta:  # need to delete selection otherwise we would fix the current position
            self.delete(self.position, tkinter.END)
        else:  # set position to end so selection starts where textentry ended
            self.position = len(self.get())
        # collect hits
        _hits = []
        for element in self._completion_list:
            if element.lower().startswith(self.get().lower()):  # Match case insensitively
                _hits.append(element)
        # if we have a new hit list, keep this in mind
        if _hits != self._hits:
            self._hit_index = 0
            self._hits = _hits
        # only allow cycling if we are in a known hit list
        if _hits == self._hits and self._hits:
            self._hit_index = (self._hit_index + delta) % len(self._hits)
        # now finally perform the auto completion
        if self._hits:
            self.delete(0, tkinter.END)
            self.insert(0, self._hits[self._hit_index])
            self.select_range(self.position, tkinter.END)

    def handle_keyrelease(self, event):
        """event handler for the keyrelease event on this widget"""
        if event.keysym == "BackSpace":
            self.delete(self.index(tkinter.INSERT), tkinter.END)
            self.position = self.index(tkinter.END)
        if event.keysym == "Left":
            if self.position < self.index(tkinter.END):  # delete the selection
                self.delete(self.position, tkinter.END)
            else:
                self.position = self.position - 1  # delete one character
                self.delete(self.position, tkinter.END)
        if event.keysym == "Right":
            self.position = self.index(tkinter.END)  # go to end (no selection)
        if len(event.char) >=1:
            self.autocomplete()
        # No need for up/down, we'll jump to the popup
        # list at the position of the autocompletion

def split_resPic(path,key):
    key_name=path.split('_')
    return key_name[key]

def update_res():
    top.attributes("-disabled", 1)
    updatekey_win = tkinter.Tk()

    def my_close():
        top.attributes("-disabled", 0)
        updatekey_win.destroy()

    updatekey_win.protocol('WM_DELETE_WINDOW', my_close)
    updatekey_win.title('添加新数据项')
    l1 = tkinter.Label(updatekey_win, text='大项英文索引名:')
    NameEN = tkinter.Entry(updatekey_win)

    l2 = tkinter.Label(updatekey_win, text='大项中文：')
    NameCN = tkinter.Entry(updatekey_win)

    def getdata():
        res_update.update_factor(NameEN.get(),NameCN.get())
        top.attributes("-disabled", 0)
        updatekey_win.destroy()

    Y_button = tkinter.Button(updatekey_win, text='确定', command=lambda :getdata())
    l1.pack()
    NameEN.pack()
    l2.pack()
    NameCN.pack()
    Y_button.pack()
def get_gen_list():
    f1 = open('./pokemon_data/gen_list.json', 'r', encoding='utf-8')
    pokemon_gen = json.load(f1)
    f1.close()
    gen_list= []
    for i in range(len(pokemon_gen['gen_list'])):#遍历gen_list,查询是否存在该世代
        gen_data = pokemon_gen['gen_list'][i - 1]
        gen_list.append(gen_data['gen_name'])
    return gen_list
def get_gen_listTotal(name):
    global now_gen
    global check_num
    f1 = open('./pokemon_data/gen_list.json', 'r', encoding='utf-8')
    pokemon_gen = json.load(f1)
    f1.close()
    for i in range(len(pokemon_gen['gen_list'])):#遍历gen_list,查询是否存在该世代
        gen_data = pokemon_gen['gen_list'][i - 1]
        if gen_data['gen_name']==name:
            gen_total=gen_data['gen_total']
            gen_start=gen_data['gen_startNum']
            break
    now_gen=name
    check_num=gen_start
    return gen_total

def check_pic(type,file):
    global now_gen
    global check_num
    global area
    global diffTypeStat
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    temp = pokemon_data[num]
    pokemonItem = temp[area]
    goalItem = 0
    if area == 'Normal':
        getData = diff_value_1.get()
    elif area == 'Alola':
        getData = diff_value_2.get()
    else:
        getData = diff_value_3.get()
    goalData = pokemonItem[str(getData)]
    diffTypeCN = list(diffTypeStat.values())
    diffTypeEN = list(diffTypeStat.keys())
    for item1 in diffTypeEN:
        if diffTypeStat[item1]==diff_Type_value.get():
            temp=pokeDataRes[item1]
            temp1 = list(temp.keys())
            for item2 in temp1:
                if temp[item2]==diff_value.get():
                    break
                goalItem += 1
    dic_pic=file[0].decode('gbk')
    #print(dic_pic)
    check_img=Image.open(dic_pic)
    if area=='Normal':
        if type == 'icon':
                if check_img.size[0] == 64 & check_img.size[1] == 64:
                    copyfile(dic_pic,'./pokemon_data/' + now_gen + '/Icon/' + str(check_num) + '_' + area + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_icon.png')
                else:
                    showinfo('文件错误','icon尺寸应该为64*64')
                    print('size error!')
        else:
            if check_img.size[0] == 96 & check_img.size[1] == 96:
                print('./pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_' + type + '.png')
                copyfile(dic_pic,'./pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_' + type + '.png')
            else:
                showinfo('文件错误', '对战图尺寸应该为96*96')
                print('size error!')
    elif area=='Alola':
        if type == 'icon':
                if check_img.size[0] == 64 & check_img.size[1] == 64:
                    copyfile(dic_pic, './pokemon_data/' + now_gen + '/Icon/' + str(check_num) + '_' + area + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_icon.png')
                else:
                    showinfo('文件错误', 'icon尺寸应该为64*64')
                    print('size error!')
        else:
            if check_img.size[0] == 96 & check_img.size[1] == 96:
                print('./pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_' + type + '.png')
                copyfile(dic_pic,'./pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_' + type + '.png')
            else:
                showinfo('文件错误', '对战图尺寸应该为96*96')
                print('size error!')
    else:
        if type == 'icon':
                if check_img.size[0] == 64 & check_img.size[1] == 64:
                    copyfile(dic_pic,'./pokemon_data/' + now_gen + '/Icon/' + str(check_num) + '_' + area + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_icon.png')
                else:
                    showinfo('文件错误', 'icon尺寸应该为64*64')
                    print('size error!')
        else:
            if check_img.size[0] == 96 & check_img.size[1] == 96:
                print('./pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_3.get()) + '_' + type + '.png')
                copyfile(dic_pic,'./pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_3.get()) + '_' + type + '.png')
            else:
                showinfo('文件错误', '对战图尺寸应该为96*96')
                print('size error!')
    get_pic(0)

def get_pic(forms):
    global im_icon
    global im_front
    global im_back
    global im_fronts
    global im_backs
    global Ico_open
    global Front_open
    global Back_open
    global FrontS_open
    global BackS_open
    global now_gen
    global area
    global check_num
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    temp = pokemon_data[num]
    pokemonItem = temp[area]
    goalItem=0
    if area == 'Normal':
        getData = diff_value_1.get()
    elif area == 'Alola':
        getData = diff_value_2.get()
    else:
        getData = diff_value_3.get()
    goalData=pokemonItem[str(getData)]
    diffTypeEN = list(diffTypeStat.keys())
    for item1 in diffTypeEN:
        if diffTypeStat[item1] == diff_Type_value.get():
            temp = pokeDataRes[item1]
            temp1 = list(temp.keys())
            for item2 in temp1:
                if temp[item2] == diff_value.get():
                    break
                goalItem += 1
    print(area)
    if area=='Normal':
        dic_icon = './pokemon_data/' + now_gen + '/Icon/' + str(check_num) + '_' + area + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_icon.png'
        dic_front = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_front.png'
        dic_back = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_back.png'
        dic_frontS = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_fronts.png'
        dic_backS = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_1.get()) + '_backs.png'
    elif area=='Alola':
        dic_icon = './pokemon_data/' + now_gen + '/Icon/' + str(check_num) + '_' + area + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_icon.png'
        dic_front = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_front.png'
        dic_back = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_back.png'
        dic_frontS = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_fronts.png'
        dic_backS = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_2.get()) + '_backs.png'
    else:
        dic_icon = './pokemon_data/' + now_gen + '/Icon/' + str(check_num) +'_'+area+'_'+str(goalItem)+'_'+str(diff_value_3.get())+'_icon.png'
        dic_front = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_3.get()) + '_front.png'
        dic_back = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_3.get()) + '_back.png'
        dic_frontS = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_3.get()) + '_fronts.png'
        dic_backS = './pokemon_data/' + now_gen + '/' + area + '/' + str(check_num) + '_' + str(goalItem) + '_' + str(diff_value_3.get()) + '_backs.png'
    print(dic_back)
    if os.path.exists(dic_icon)==True:
        im_icon=Image.open(dic_icon)
    else:
        im_icon = Image.open('./res/0_icon.png')
    if os.path.exists(dic_front)==True:
        im_front=Image.open(dic_front)
    else:
        im_front= Image.open('./res/0_front.png')
    if os.path.exists(dic_back)==True:
        im_back=Image.open(dic_back)
    else:
        im_back = Image.open('./res/0_back.png')
    if os.path.exists(dic_frontS)==True:
        im_fronts=Image.open(dic_frontS)
    else:
        im_fronts= Image.open('./res/0_fronts.png')
    if os.path.exists(dic_backS)==True:
        im_backs=Image.open(dic_backS)
    else:
        im_backs = Image.open('./res/0_backs.png')

    Ico_open=ImageTk.PhotoImage(image=im_icon)
    Front_open = ImageTk.PhotoImage(image=im_front)
    Back_open = ImageTk.PhotoImage(image=im_back)
    FrontS_open = ImageTk.PhotoImage(image=im_fronts)
    BackS_open = ImageTk.PhotoImage(image=im_backs)
    #print(Image.open('./res/0_icon.png').size[0])
    pokePIC_Ico['image']=Ico_open
    pokePIC_Front['image']=Front_open
    pokePIC_Back['image']=Back_open
    pokePIC_Front_S['image']=FrontS_open
    pokePIC_Back_S['image']=BackS_open

def clean_pokemondata():
    global pokemon_dataList
    pokemon_dataList = json.load(open('./pokemon_data/'+now_gen+'/pokemon.json', 'r', encoding='utf-8'))

def createGenList():
    top.attributes("-disabled", 1)
    newWin = tkinter.Tk()

    def my_close():
        top.attributes("-disabled", 0)
        newWin.destroy()

    newWin.protocol('WM_DELETE_WINDOW', my_close)
    newWin.title('创建世代')
    l1 = tkinter.Label(newWin, text='世代名:')
    genName = tkinter.Entry(newWin)

    l2 = tkinter.Label(newWin, text='开始全国编号：')
    genStart = tkinter.Entry(newWin)

    l3 = tkinter.Label(newWin, text='世代新精灵数目：')
    genNum = tkinter.Entry(newWin)

    def commit_gen_data():
        g = genName.get()
        s = int(genStart.get())
        n = int(genNum.get())
        main.create_generation(g,s,n)
        top.attributes("-disabled", 0)
        newWin.destroy()

    Y_button = tkinter.Button(newWin, text='确定', command=commit_gen_data)
    l1.pack()
    genName.pack()
    l2.pack()
    genStart.pack()
    l3.pack()
    genNum.pack()
    Y_button.pack()

def openlist(name):
    global now_gen
    global check_num
    global pokemon_dataList
    destory_pack()
    start_frame.pack_forget()
    listBox_poke.pack_forget()
    scroll.pack_forget()
    num=int(get_gen_listTotal(name))
    pokemon_dataList=json.load(open('./pokemon_data/'+name+'/pokemon.json','r',encoding='utf-8'))
    now_gen=name
    listBox_poke.delete(0,1000)
    print(name)
    temp=pokemon_dataList['pokemon_list'][0]
    check_num=temp['num']
    for i in range(num):
        pokemonItem=pokemon_dataList['pokemon_list'][i]
        if pokemonItem['species']=='':
            item='NO.'+str(int(pokemonItem['num']))+ ':-----------'
            #print(item)
            listBox_poke.insert(tkinter.END,item)
        else:
            item='NO.'+str(int(pokemonItem['num']))+':'+pokemonItem['speciesChinese']
            listBox_poke.insert(tkinter.END,item)
        print(item)
    print(now_gen)
    print(check_num)
    listBox_poke['yscrollcommand'] = scroll.set
    scroll.config(command=listBox_poke.yview)
    listBox_poke.bind('<<ListboxSelect>>',list_Select)
    listBox_poke.pack(side=tkinter.LEFT, fill=tkinter.BOTH)
    scroll.pack(side=tkinter.LEFT, ipadx=0, fill=tkinter.Y)

def show_BattleData():
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    temparea = pokemon_data[num]
    temp=temparea[str(area)]
    if area == 'Normal':
        getData = diff_value_1.get()
    elif area == 'Alola':
        getData = diff_value_2.get()
    else:
        getData = diff_value_3.get()
    if int(getData)<len(temp):
        pokemonItemData = temp[str(getData)]
    else:
        pokemonItemData = temp['0']
    def saveData():
        print(pokemonItemData)
    SaveButton['command']=saveData()
    return True
def list_Select(event):
    global check_num
    global now_gen
    print(listBox_poke.get(listBox_poke.curselection()))
    str1=listBox_poke.get(listBox_poke.curselection())
    check_num = int((str1.split(':')[0]).split('.')[1])
    listBox_poke['height']=10
    print(now_gen)
    print(area)
    print(check_num)
    Data_Notebook.select('.!frame2.!frame3')
    destory_pack()
    diff_value_1.set('0')
    diff_value_2.set('0')
    diff_value_3.set('0')
    pokemenu_update()

def check_pokedex():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData = pokemon_data[num]
    pokemonAreaData = pokemonItemData[area]
    if area == 'Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
    pokemonPokedex = pokemonSelfData['pokedex']
    pokemonformesName = pokemonSelfData['formesName']
    pokemonKind = pokemonSelfData['kind']
    if area=='Normal':
        pokedex_text_Normal.delete('1.0', 'end')
        if pokemonPokedex == '':
            pokedex_text_Normal.insert('end', '<请输入内容>')
        else:
            pokedex_text_Normal.insert('end', pokemonPokedex)
        if pokemonformesName == '':
            pokemFormNameString_Normal.set('No_nickName')
            pokeFormName_Entr_Normal['textvariable'] = pokemFormNameString_Normal
        else:
            pokemFormNameString_Normal.set(pokemonformesName)
            pokeFormName_Entr_Normal['textvariable'] = pokemFormNameString_Normal
        if pokemonKind == '':
            pokekindString_Normal.set('<请填入类型>')

            pokekind_Entr_Normal['textvariable'] = pokekindString_Normal
        else:
            pokekindString_Normal.set(pokemonKind)
            print(1)
            pokekind_Entr_Normal['textvariable'] = pokekindString_Normal
    elif area=='Alola':
        pokedex_text_Alola.delete('1.0', 'end')
        if pokemonPokedex == '':
            pokedex_text_Alola.insert('end', '<请输入内容>')
        else:
            pokedex_text_Alola.insert('end', pokemonPokedex)
        if pokemonformesName == '':
            pokemFormNameString_Alola.set('No_nickName')
            pokeFormName_Entr_Alola['textvariable'] = pokemFormNameString_Alola
        else:
            pokemFormNameString_Alola.set(pokemonformesName)
            pokeFormName_Entr_Alola['textvariable'] = pokemFormNameString_Alola
        if pokemonKind == '':
            pokekindString_Alola.set('<请填入类型>')

            pokekind_Entr_Alola['textvariable'] = pokekindString_Alola
        else:
            pokekindString_Alola.set(pokemonKind)
            print(1)
            pokekind_Entr_Alola['textvariable'] = pokekindString_Alola
    else:
        pokedex_text_Galar.delete('1.0', 'end')
        if pokemonPokedex == '':
            pokedex_text_Galar.insert('end', '<请输入内容>')
        else:
            pokedex_text_Galar.insert('end', pokemonPokedex)
        if pokemonformesName == '':
            pokemFormNameString_Galar.set('No_nickName')
            pokeFormName_Entr_Galar['textvariable'] = pokemFormNameString_Galar
        else:
            pokemFormNameString_Galar.set(pokemonformesName)
            pokeFormName_Entr_Galar['textvariable'] = pokemFormNameString_Galar
        if pokemonKind == '':
            pokekindString_Galar.set('<请填入类型>')

            pokekind_Entr_Galar['textvariable'] = pokekindString_Galar
        else:
            pokekindString_Galar.set(pokemonKind)
            print(1)
            pokekind_Entr_Galar['textvariable'] = pokekindString_Galar

def check_spinBox():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData = pokemon_data[num]
    pokemonAreaData = pokemonItemData[area]
    if area == 'Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
    pokemonCatchRare = pokemonSelfData['catchRare']
    pokemonheightm = pokemonSelfData['heightm']
    pokemonweightkg = pokemonSelfData['weightkg']
    if area=='Normal':
        if pokemonCatchRare == '':
            catchRare_Normal_str.set(3)
        else:
            catchRare_Normal_str.set(pokemonCatchRare)
        if pokemonheightm == '':
            heightm_Normal_str.set(0.0)
        else:
            heightm_Normal_str.set(pokemonheightm)
        if pokemonweightkg == '':
            weightkg_Normal_str.set(0.0)
        else:
            weightkg_Normal_str.set(pokemonweightkg)
    elif area=='Alola':
        if pokemonCatchRare == '':
            catchRare_Alola_str.set(3)
        else:
            catchRare_Alola_str.set(pokemonCatchRare)
        if pokemonheightm == '':
            heightm_Alola_str.set(0.0)
        else:
            heightm_Alola_str.set(pokemonheightm)
        if pokemonweightkg == '':
            weightkg_Alola_str.set(0.0)
        else:
            weightkg_Alola_str.set(pokemonweightkg)
    else:
        if pokemonCatchRare == '':
            catchRare_Galar_str.set(3)
        else:
            catchRare_Galar_str.set(pokemonCatchRare)
        if pokemonheightm == '':
            heightm_Galar_str.set(0.0)
        else:
            heightm_Galar_str.set(pokemonheightm)
        if pokemonweightkg == '':
            weightkg_Galar_str.set(0.0)
        else:
            weightkg_Galar_str.set(pokemonweightkg)

def check_type():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global Type_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]
    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
        pokemonType = pokemonSelfData['types']
        if pokemonType == []:
            typeList1_Normal.set('none')
            typeList2_Normal.set('none')
        else:
            TypesIN = pokemonType
            if len(pokemonType) == 1:
                type1 = types[TypesIN[0]]
                print(type1)
                typeList1_Normal.set(type1)
                typeList2_Normal.set('none')
            elif len(pokemonType) == 2:
                type1 = types[TypesIN[0]]
                type2 = types[TypesIN[1]]
                typeList1_Normal.set(type1)
                typeList2_Normal.set(type2)
    elif area=='Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonType = pokemonSelfData['types']
        if pokemonType == []:
            typeList1_Alola.set('none')
            typeList2_Alola.set('none')
        else:
            TypesIN = pokemonType
            if len(pokemonType) == 1:
                type1 = types[TypesIN[0]]
                print(type1)
                typeList1_Alola.set(type1)
                typeList2_Alola.set('none')
            elif len(pokemonType) == 2:
                type1 = types[TypesIN[0]]
                type2 = types[TypesIN[1]]
                typeList1_Alola.set(type1)
                typeList2_Alola.set(type2)
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
        pokemonType = pokemonSelfData['types']
        if pokemonType == []:
            typeList1_Galar.set('none')
            typeList2_Galar.set('none')
        else:
            TypesIN = pokemonType
            if len(pokemonType) == 1:
                type1 = types[TypesIN[0]]
                print(type1)
                typeList1_Galar.set(type1)
                typeList2_Galar.set('none')
            elif len(pokemonType) == 2:
                type1 = types[TypesIN[0]]
                type2 = types[TypesIN[1]]
                typeList1_Galar.set(type1)
                typeList2_Galar.set(type2)

def check_Abilities():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]

    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
        pokemonAbilities = pokemonSelfData['abilities']
        pokemonAbility_1 = pokemonAbilities['0']
        pokemonAbility_2 = pokemonAbilities['1']
        pokemonAbility_H = pokemonAbilities['H']
        if pokemonAbility_1 == 'none':
            AbilitiesMenu1_Normal.set('none')
        else:
            AbilitiesMenu1_Normal.set(Abilities[pokemonAbility_1])
        if pokemonAbility_2 == 'none':
            AbilitiesMenu2_Normal.set('none')
        else:
            AbilitiesMenu2_Normal.set(Abilities[pokemonAbility_2])
        if pokemonAbility_H == 'none':
            AbilitiesMenu3_Normal.set('none')
        else:
            AbilitiesMenu3_Normal.set(Abilities[pokemonAbility_H])
    elif area=='Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonAbilities = pokemonSelfData['abilities']
        pokemonAbility_1 = pokemonAbilities['0']
        pokemonAbility_2 = pokemonAbilities['1']
        pokemonAbility_H = pokemonAbilities['H']
        if pokemonAbility_1 == 'none':
            AbilitiesMenu1_Alola.set('none')
        else:
            AbilitiesMenu1_Alola.set(Abilities[pokemonAbility_1])
        if pokemonAbility_2 == 'none':
            AbilitiesMenu2_Alola.set('none')
        else:
            AbilitiesMenu2_Alola.set(Abilities[pokemonAbility_2])
        if pokemonAbility_H == 'none':
            AbilitiesMenu3_Alola.set('none')
        else:
            AbilitiesMenu3_Alola.set(Abilities[pokemonAbility_H])
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
        pokemonAbilities = pokemonSelfData['abilities']
        pokemonAbility_1 = pokemonAbilities['0']
        pokemonAbility_2 = pokemonAbilities['1']
        pokemonAbility_H = pokemonAbilities['H']
        if pokemonAbility_1 == 'none':
            AbilitiesMenu1_Galar.set('none')
        else:
            AbilitiesMenu1_Galar.set(Abilities[pokemonAbility_1])
        if pokemonAbility_2 == 'none':
            AbilitiesMenu2_Galar.set('none')
        else:
            AbilitiesMenu2_Galar.set(Abilities[pokemonAbility_2])
        if pokemonAbility_H == 'none':
            AbilitiesMenu3_Galar.set('none')
        else:
            AbilitiesMenu3_Galar.set(Abilities[pokemonAbility_H])


def check_Egg():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global Egg_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]

    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
        pokemonEgg = pokemonSelfData['eggGroups']
        if pokemonEgg == []:
            EggList1_Normal.set('none')
            EggList2_Normal.set('none')
        else:
            EggIN = pokemonEgg
            if len(pokemonEgg) == 1:
                Egg1 = Eggs[EggIN[0]]
                print(Egg1)
                EggList1_Normal.set(Egg1)
                EggList2_Normal.set('none')
            elif len(pokemonEgg) == 2:
                Egg1 = Eggs[EggIN[0]]
                Egg2 = Eggs[EggIN[1]]
                EggList1_Normal.set(Egg1)
                EggList2_Normal.set(Egg2)
    elif area=='Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonEgg = pokemonSelfData['eggGroups']
        if pokemonEgg == []:
            EggList1_Alola.set('none')
            EggList2_Alola.set('none')
        else:
            EggIN = pokemonEgg
            if len(pokemonEgg) == 1:
                Egg1 = Eggs[EggIN[0]]
                print(Egg1)
                EggList1_Alola.set(Egg1)
                EggList2_Alola.set('none')
            elif len(pokemonEgg) == 2:
                Egg1 = Eggs[EggIN[0]]
                Egg2 = Eggs[EggIN[1]]
                EggList1_Alola.set(Egg1)
                EggList2_Alola.set(Egg2)
    else:
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonEgg = pokemonSelfData['eggGroups']
        if pokemonEgg == []:
            EggList1_Galar.set('none')
            EggList2_Galar.set('none')
        else:
            EggIN = pokemonEgg
            if len(pokemonEgg) == 1:
                Egg1 = Eggs[EggIN[0]]
                print(Egg1)
                EggList1_Galar.set(Egg1)
                EggList2_Galar.set('none')
            elif len(pokemonEgg) == 2:
                Egg1 = Eggs[EggIN[0]]
                Egg2 = Eggs[EggIN[1]]
                EggList1_Galar.set(Egg1)
                EggList2_Galar.set(Egg2)

def check_ColorBodily():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global Color_Normal
    global bodilyForm_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]

    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
        pokemonbodilyForm = pokemonSelfData['bodilyForm']
        pokemonColor = pokemonSelfData['color']
        if pokemonbodilyForm == '':
            bodilyFormList_Normal.set('none')
        else:
            bodilyFormIN = pokemonbodilyForm
            BodilyForm1 = bodilyForms[bodilyFormIN]
            bodilyFormList_Normal.set(BodilyForm1)
        if pokemonColor == '':
            ColorList_Normal.set('none')
        else:
            ColorIN = pokemonColor
            Color = Colors[ColorIN]
            ColorList_Normal.set(Color)
    elif area=='Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonbodilyForm = pokemonSelfData['bodilyForm']
        pokemonColor = pokemonSelfData['color']
        if pokemonbodilyForm == '':
            bodilyFormList_Alola.set('none')
        else:
            bodilyFormIN = pokemonbodilyForm
            BodilyForm1 = bodilyForms[bodilyFormIN]
            bodilyFormList_Alola.set(BodilyForm1)
        if pokemonColor == '':
            ColorList_Alola.set('none')
        else:
            ColorIN = pokemonColor
            Color = Colors[ColorIN]
            ColorList_Alola.set(Color)
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
        pokemonbodilyForm = pokemonSelfData['bodilyForm']
        pokemonColor = pokemonSelfData['color']
        if pokemonbodilyForm == '':
            bodilyFormList_Galar.set('none')
        else:
            bodilyFormIN = pokemonbodilyForm
            BodilyForm1 = bodilyForms[bodilyFormIN]
            bodilyFormList_Galar.set(BodilyForm1)
        if pokemonColor == '':
            ColorList_Galar.set('none')
        else:
            ColorIN = pokemonColor
            Color = Colors[ColorIN]
            ColorList_Galar.set(Color)

def check_LevelUpRare():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global LevelUpRare_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]
    if area == 'Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
    pokemonLevelUpRare=pokemonSelfData['levelupRare']
    if area=='Normal':
        if pokemonLevelUpRare == '':
            LevelUpRareList_Normal.set('none')
        else:
            LevelUpRareIN = pokemonLevelUpRare
            LevelUpRare = LevelUpRares[LevelUpRareIN]
            LevelUpRareList_Normal.set(LevelUpRare)
    elif area=='Alola':
        if pokemonLevelUpRare == '':
            LevelUpRareList_Alola.set('none')
        else:
            LevelUpRareIN = pokemonLevelUpRare
            LevelUpRare = LevelUpRares[LevelUpRareIN]
            LevelUpRareList_Alola.set(LevelUpRare)
    else:
        if pokemonLevelUpRare == '':
            LevelUpRareList_Galar.set('none')
        else:
            LevelUpRareIN = pokemonLevelUpRare
            LevelUpRare = LevelUpRares[LevelUpRareIN]
            LevelUpRareList_Galar.set(LevelUpRare)

def check_genderTatio():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]
    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
    pokemongenderTatio=pokemonSelfData['genderTatio']
    if area=='Normal':
        if str(pokemongenderTatio) == "":
            genderTatioList_Normal.set('none')
        else:
            genderTatioIN = '[' + str(pokemongenderTatio[0]) + ',' + str(pokemongenderTatio[1]) + ']'
            print(genderTatioIN)
            genderTatioGet = genderTatios[genderTatioIN]
            genderTatioList_Normal.set(genderTatioGet)
    elif area=='Alola':
        if str(pokemongenderTatio) == '':
            genderTatioList_Alola.set('none')
        else:
            genderTatioIN = '[' + str(pokemongenderTatio[0]) + ',' + str(pokemongenderTatio[1]) + ']'
            genderTatioGet = genderTatios[genderTatioIN]
            genderTatioList_Alola.set(genderTatioGet)
    else:
        if str(pokemongenderTatio) == '':
            genderTatioList_Galar.set('none')
        else:
            genderTatioIN = '[' + str(pokemongenderTatio[0]) + ',' + str(pokemongenderTatio[1]) + ']'
            genderTatioGet = genderTatios[genderTatioIN]
            genderTatioList_Galar.set(genderTatioGet)

def check_hatchRare():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global hatchRare_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]
    if area == 'Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
    pokemonhatchRare=pokemonSelfData['hatchRare']
    if area=='Normal':
        if pokemonhatchRare == '':
            hatchRareList_Normal.set('none')
        else:
            hatchRareList_Normal.set(pokemonhatchRare)
    elif area=='Alola':
        if pokemonhatchRare == '':
            hatchRareList_Alola.set('none')
        else:
            hatchRareList_Alola.set(pokemonhatchRare)
    else:
        if pokemonhatchRare == '':
            hatchRareList_Galar.set('none')
        else:
            hatchRareList_Galar.set(pokemonhatchRare)

def check_startFriendship():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global startFriendship_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]
    if area == 'Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
    pokemonstartFriendship=pokemonSelfData['startFriendship']
    if area=='Normal':
        if pokemonstartFriendship == '':
            startFriendshipList_Normal.set('none')
        else:
            startFriendshipList_Normal.set(pokemonstartFriendship)
    elif area=='Alola':
        if pokemonstartFriendship == '':
            startFriendshipList_Alola.set('none')
        else:
            startFriendshipList_Alola.set(pokemonstartFriendship)
    else:
        if pokemonstartFriendship == '':
            startFriendshipList_Galar.set('none')
        else:
            startFriendshipList_Galar.set(pokemonstartFriendship)

def check_baseStats():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global hatchRare_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]

    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
        pokemonbaseStats = pokemonSelfData['baseStats']
        baseStats_Normal_hp.set(str(pokemonbaseStats['hp']))
        baseStats_Normal_attack.set(str(pokemonbaseStats['attack']))
        baseStats_Normal_specialAttack.set(str(pokemonbaseStats['specialAttack']))
        baseStats_Normal_specialDefense.set(str(pokemonbaseStats['specialDefense']))
        baseStats_Normal_defense.set(str(pokemonbaseStats['defense']))
        baseStats_Normal_speed.set(str(pokemonbaseStats['speed']))

        baseStats_Normal_hp_Entr['textvariable'] = baseStats_Normal_hp
        baseStats_Normal_attack_Entr['textvariable'] = baseStats_Normal_attack
        baseStats_Normal_specialAttack_Entr['textvariable'] = baseStats_Normal_specialAttack
        baseStats_Normal_specialDefense_Entr['textvariable'] = baseStats_Normal_specialDefense
        baseStats_Normal_defense_Entr['textvariable'] = baseStats_Normal_defense
        baseStats_Normal_speed_Entr['textvariable'] = baseStats_Normal_speed
    elif area=='Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonbaseStats = pokemonSelfData['baseStats']
        baseStats_Alola_hp.set(str(pokemonbaseStats['hp']))
        baseStats_Alola_attack.set(str(pokemonbaseStats['attack']))
        baseStats_Alola_specialAttack.set(str(pokemonbaseStats['specialAttack']))
        baseStats_Alola_specialDefense.set(str(pokemonbaseStats['specialDefense']))
        baseStats_Alola_defense.set(str(pokemonbaseStats['defense']))
        baseStats_Alola_speed.set(str(pokemonbaseStats['speed']))

        baseStats_Alola_hp_Entr['textvariable'] = baseStats_Alola_hp
        baseStats_Alola_attack_Entr['textvariable'] = baseStats_Alola_attack
        baseStats_Alola_specialAttack_Entr['textvariable'] = baseStats_Alola_specialAttack
        baseStats_Alola_specialDefense_Entr['textvariable'] = baseStats_Alola_specialDefense
        baseStats_Alola_defense_Entr['textvariable'] = baseStats_Alola_defense
        baseStats_Alola_speed_Entr['textvariable'] = baseStats_Alola_speed
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
        pokemonbaseStats = pokemonSelfData['baseStats']
        baseStats_Galar_hp.set(str(pokemonbaseStats['hp']))
        baseStats_Galar_attack.set(str(pokemonbaseStats['attack']))
        baseStats_Galar_specialAttack.set(str(pokemonbaseStats['specialAttack']))
        baseStats_Galar_specialDefense.set(str(pokemonbaseStats['specialDefense']))
        baseStats_Galar_defense.set(str(pokemonbaseStats['defense']))
        baseStats_Galar_speed.set(str(pokemonbaseStats['speed']))

        baseStats_Galar_hp_Entr['textvariable'] = baseStats_Galar_hp
        baseStats_Galar_attack_Entr['textvariable'] = baseStats_Galar_attack
        baseStats_Galar_specialAttack_Entr['textvariable'] = baseStats_Galar_specialAttack
        baseStats_Galar_specialDefense_Entr['textvariable'] = baseStats_Galar_specialDefense
        baseStats_Galar_defense_Entr['textvariable'] = baseStats_Galar_defense
        baseStats_Galar_speed_Entr['textvariable'] = baseStats_Galar_speed

def check_basePoints():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    global hatchRare_Normal
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    pokemonItemData=pokemon_data[num]
    pokemonAreaData=pokemonItemData[area]

    if area=='Normal':
        pokemonSelfData = pokemonAreaData[diff_value_1.get()]
        pokemonbasePoints = pokemonSelfData['basePoints']
        basePoints_Normal_hp.set(str(pokemonbasePoints['hp']))
        basePoints_Normal_attack.set(str(pokemonbasePoints['attack']))
        basePoints_Normal_specialAttack.set(str(pokemonbasePoints['specialAttack']))
        basePoints_Normal_specialDefense.set(str(pokemonbasePoints['specialDefense']))
        basePoints_Normal_defense.set(str(pokemonbasePoints['defense']))
        basePoints_Normal_speed.set(str(pokemonbasePoints['speed']))

        basePoints_Normal_hp_Entr['textvariable'] = basePoints_Normal_hp
        basePoints_Normal_attack_Entr['textvariable'] = basePoints_Normal_attack
        basePoints_Normal_specialAttack_Entr['textvariable'] = basePoints_Normal_specialAttack
        basePoints_Normal_specialDefense_Entr['textvariable'] = basePoints_Normal_specialDefense
        basePoints_Normal_defense_Entr['textvariable'] = basePoints_Normal_defense
        basePoints_Normal_speed_Entr['textvariable'] = basePoints_Normal_speed
    elif area=='Alola':
        pokemonSelfData = pokemonAreaData[diff_value_2.get()]
        pokemonbasePoints = pokemonSelfData['basePoints']
        basePoints_Alola_hp.set(str(pokemonbasePoints['hp']))
        basePoints_Alola_attack.set(str(pokemonbasePoints['attack']))
        basePoints_Alola_specialAttack.set(str(pokemonbasePoints['specialAttack']))
        basePoints_Alola_specialDefense.set(str(pokemonbasePoints['specialDefense']))
        basePoints_Alola_defense.set(str(pokemonbasePoints['defense']))
        basePoints_Alola_speed.set(str(pokemonbasePoints['speed']))

        basePoints_Alola_hp_Entr['textvariable'] = basePoints_Alola_hp
        basePoints_Alola_attack_Entr['textvariable'] = basePoints_Alola_attack
        basePoints_Alola_specialAttack_Entr['textvariable'] = basePoints_Alola_specialAttack
        basePoints_Alola_specialDefense_Entr['textvariable'] = basePoints_Alola_specialDefense
        basePoints_Alola_defense_Entr['textvariable'] = basePoints_Alola_defense
        basePoints_Alola_speed_Entr['textvariable'] = basePoints_Alola_speed
    else:
        pokemonSelfData = pokemonAreaData[diff_value_3.get()]
        pokemonbasePoints = pokemonSelfData['basePoints']
        basePoints_Galar_hp.set(str(pokemonbasePoints['hp']))
        basePoints_Galar_attack.set(str(pokemonbasePoints['attack']))
        basePoints_Galar_specialAttack.set(str(pokemonbasePoints['specialAttack']))
        basePoints_Galar_specialDefense.set(str(pokemonbasePoints['specialDefense']))
        basePoints_Galar_defense.set(str(pokemonbasePoints['defense']))
        basePoints_Galar_speed.set(str(pokemonbasePoints['speed']))

        basePoints_Galar_hp_Entr['textvariable'] = basePoints_Galar_hp
        basePoints_Galar_attack_Entr['textvariable'] = basePoints_Galar_attack
        basePoints_Galar_specialAttack_Entr['textvariable'] = basePoints_Galar_specialAttack
        basePoints_Galar_specialDefense_Entr['textvariable'] = basePoints_Galar_specialDefense
        basePoints_Galar_defense_Entr['textvariable'] = basePoints_Galar_defense
        basePoints_Galar_speed_Entr['textvariable'] = basePoints_Galar_speed

def pokemon_create():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    # print(pokemon_dataList['pokemon_list'])

    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    print(num)
    tempW = pokemon_data[num]
    # print(temp)
    pokemonItem = tempW[area]
    if area=='Normal':
        getData=diff_value_1.get()
    elif area=='Alola':
        getData=diff_value_2.get()
    else:
        getData=diff_value_3.get()
    # print(pokemonItem)
    # print(pokemonItem[No])
    if int(getData) < len(pokemonItem):
        if pokemonItem[getData] == {}:
            pokemonItem[getData] = pokemon.copy()
            PokeItem_data = pokemonItem[getData]
            pokemon_dataList['pokemon_list'] = pokemon_data
        else:
            PokeItem_data = pokemonItem[getData]
            pokemon_dataList['pokemon_list'] = pokemon_data
    else:
        if pokemonItem['0'] == {}:
            pokemonItem['0'] = pokemon.copy()
            PokeItem_data = pokemonItem['0']
            pokemon_dataList['pokemon_list'] = pokemon_data
        else:
            PokeItem_data = pokemonItem['0']
            pokemon_dataList['pokemon_list'] = pokemon_data
    print(pokemonItem)
    tempItem = pokemonItem[getData]
    pokemonForm = tempItem['formsType']
    print(pokemonForm)
    updateData = json.load(open('./res/resData.json', encoding='utf-8'))
    resData = updateData['res']
    FormsDiff=resData['formsDiff']
    Formdiff=resData[pokemonForm]
    diff_Type_value.set(FormsDiff[pokemonForm])
    Forms = PokeItem_data['forms']
    new_menu = list(Formdiff.values())
    pokePIC_diff.set_menu('', *new_menu)
    diff_value.set(new_menu[0])
    print('PokeItem_data')

def pokemenu_update():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global pokemon
    global area
    global diff_var
    global Forms
    global pokePIC_diff
    clean_pokemondata()
    pokemon_create()
    temp321=pokemon_dataList['pokemon_list']
    pokemon_data = temp321[main.check_pokemon_data(now_gen,check_num)]
    nameEN = pokemon_data['species']
    nameCN = pokemon_data['speciesChinese']
    pokemon_nameCN.set(nameCN)
    pokemon_nameEN.set(nameEN)
    nameEN_Entr['textvariable']=pokemon_nameEN
    nameCN_Entr['textvariable']=pokemon_nameCN
    print(pokemon_data[area])
    data_len = len(pokemon_data)
    area_name = []
    area_data = []
    data_key = list(pokemon_data.keys())
    data_value = list(pokemon_data.values())
    for i in range(data_len):
        if i > 2:
            area_name.append(data_key[i])
            area_data.append(data_value[i])
    #print(area_name, area_data)
    pokemon_NUM['text'] = 'No.' + str(check_num)
    Normal_diff_Button['command']=lambda x=Forms:change_list_Formes(x)
    Alola_diff_Button['command'] = lambda x=Forms: change_list_Formes(x)
    Galar_diff_Button['command'] = lambda x=Forms: change_list_Formes(x)
    use_pack()
    show_diff()
    show_BattleData()
    diffListUpdate()
    check_battleData()
    Data_Notebook.bind('<<NotebookTabChanged>>',tab_change)


def diffListUpdate():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global area
    global diff_value_1
    global diff_values_1
    global Normal_diff
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    tempW = pokemon_data[num]
    pokemonItem = tempW[area]
    if area=='Normal':
        pokemonList = list(pokemonItem.keys())
        Normal_diff.set_menu('', *pokemonList)
        Normal_diff.update()
    elif area=='Alola':
        pokemonList = list(pokemonItem.keys())
        Alola_diff.set_menu('', *pokemonList)
        Alola_diff.update()
    else:
        pokemonList = list(pokemonItem.keys())
        Galar_diff.set_menu('', *pokemonList)
        Galar_diff.update()


def check_battleData():
    check_type()
    check_Egg()
    check_ColorBodily()
    check_LevelUpRare()
    check_hatchRare()
    check_baseStats()
    check_basePoints()
    check_startFriendship()
    check_pokedex()
    check_spinBox()
    check_Abilities()
    check_genderTatio()

def tab_change(text):
    global area
    text = Data_Notebook.select()
    print(text)
    if text=='.!frame2.!frame3':
        area='Normal'
        diff_value_1.set(0)
        clean_pokemondata()
        pokemon_create()
        diffListUpdate()
        show_diff()
        show_BattleData()
        check_battleData()
    if text=='.!frame2.!frame4':
        area='Alola'
        diff_value_2.set(0)
        clean_pokemondata()
        pokemon_create()
        pokemon_create()
        show_diff()
        show_BattleData()
        check_battleData()
    if text == '.!frame2.!frame5':
        area='Galar'
        diff_value_3.set(0)
        clean_pokemondata()
        pokemon_create()
        pokemon_create()
        show_diff()
        show_BattleData()
        check_battleData()

def update_key():
    KeyMimMenu.delete(0,100)
    updateData = json.load(open('./res/resData.json', encoding='utf-8'))
    goalData=updateData['nameCN']
    print(goalData)
    dataKey=list(goalData.keys())
    for i in dataKey:
        KeyMimMenu.add_command(label=goalData[i],command= lambda key=i:update_KEY(key))

def update_KEY(name):
    top.attributes("-disabled", 1)
    updatekey_win= tkinter.Tk()
    def my_close():
        top.attributes("-disabled", 0)
        updatekey_win.destroy()

    updatekey_win.protocol('WM_DELETE_WINDOW', my_close)
    updatekey_win.title('添加新'+name)
    l1 = tkinter.Label(updatekey_win, text='英文索引名:')
    NameEN = tkinter.Entry(updatekey_win)

    l2 = tkinter.Label(updatekey_win, text='中文：')
    NameCN = tkinter.Entry(updatekey_win)

    def getdata():
        res_update.update_choice(name,NameEN.get(),NameCN.get())
        top.attributes("-disabled", 0)
        updatekey_win.destroy()

    Y_button = tkinter.Button(updatekey_win, text='确定', command=lambda :getdata())
    l1.pack()
    NameEN.pack()
    l2.pack()
    NameCN.pack()
    Y_button.pack()

def update_formKey():
    FormKeyMimNenu.delete(0,100)
    updateData = json.load(open('./res/resData.json', encoding='utf-8'))
    goal_Data=updateData['res']
    goalData = goal_Data['formsDiff']
    dataKey=list(goalData.keys())
    for i in dataKey:
        FormKeyMimNenu.add_command(label=goalData[i],command= lambda key=i:update_formMenu(key))

def update_formMenu(name):
    top.attributes("-disabled", 1)
    updatekey_win= tkinter.Tk()
    def my_close():
        top.attributes("-disabled", 0)
        updatekey_win.destroy()

    updatekey_win.protocol('WM_DELETE_WINDOW', my_close)
    updatekey_win.title('修改' + name)

    updateData = json.load(open('./res/resData.json', encoding='utf-8'))
    goal_Data = updateData['res']

    Listbox = tkinter.Listbox(updatekey_win)

    if name in goal_Data.keys():
        goalData = goal_Data[name]
        Key = list(goalData.keys())
        value = list(goalData.values())
        lenNum = len(Key)
    else:
        Key = ['none']
        value = ['基本形态']
        lenNum = len(Key)

    for i in range(lenNum):
        print(Key[i])
        item_1 = Key[i] + ':' + value[i]
        Listbox.insert(tkinter.END, item_1)
    Listbox.pack(side=tkinter.LEFT, fill=tkinter.BOTH)
    DeleteButton = tkinter.Button(updatekey_win, text='删除', command=lambda x=Listbox: x.delete("active"))
    No_Label = tkinter.Label(updatekey_win, text='英语命名')
    Name_Label = tkinter.Label(updatekey_win, text='中文命名')
    No = tkinter.Entry(updatekey_win)
    Name = tkinter.Entry(updatekey_win)

    def InsertnewData():
        item = str(No.get()) + ':' + str(Name.get())
        Listbox.insert(tkinter.END, item)

    def commit():
        oldlist = Listbox.get(0, 1000)
        newlist = {}
        for item_2 in oldlist:
            temp = item_2.split(':')
            newlist[temp[0]] = temp[1]
        goal_Data[name] =newlist
        updateData['res']=goal_Data
        jsondata = json.dumps(updateData, ensure_ascii=False, indent=4, separators=(',', ':'))
        f = open('./res/resData.json', 'w', encoding='utf-8')
        f.write(jsondata)
        f.close()
        top.attributes("-disabled", 0)
        updatekey_win.destroy()

    InsertButton = tkinter.Button(updatekey_win, text='添加', command=InsertnewData)
    commitButton = tkinter.Button(updatekey_win, text='更新', command=commit)
    DeleteButton.pack()
    No_Label.pack()
    No.pack()
    Name_Label.pack()
    Name.pack()
    InsertButton.pack()
    commitButton.pack()

def cleanPack():
    DataFrame_Alola.pack_forget()
    SaveButton_Alola.pack_forget()
    DataFrame_Galar.pack_forget()
    SaveButton_Galar.pack_forget()
    SaveButton.pack_forget()
    DataFrame.pack_forget()
def showPack():
    SaveButton.pack()
    DataFrame.pack(anchor=tkinter.S)
    DataFrame_Alola.pack(anchor=tkinter.S)
    SaveButton_Alola.pack()
    DataFrame_Galar.pack(anchor=tkinter.S)
    SaveButton_Galar.pack()
def destory_pack():
    start_frame.pack_forget()
    Normal_diff_Button.pack_forget()
    cleanPack()
    pokePIC_diff_frame.pack_forget()
    pokePICdiffTypeFrame.pack_forget()
    pokePICdiffFrame.pack_forget()
    pokePIC_diff_Type_label.pack_forget()
    pokePIC_diff_Type.pack_forget()
    pokePIC_diff_label.pack_forget()
    pokePIC_diff.pack_forget()
    pokePIC_Shine_label.pack_forget()
    pokePIC_Normal_label.pack_forget()
    pokedex_frame.pack_forget()
    pokeNUMNAM_frame.pack_forget()
    pokedex_top.pack_forget()
    pokedex_bottom.pack_forget()
    pokeNUMNAM_frame.pack_forget()
    pokeNUM_frame.pack_forget()
    pokeNAMC_frame.pack_forget()
    pokeNAME_frame.pack_forget()
    pokePIC_Ico.pack_forget()
    pokePIC_battle.pack_forget()
    pokePIC_Normal.pack_forget()
    pokePIC_shine.pack_forget()

    pokePIC_Front.pack_forget()
    pokePIC_Back.pack_forget()
    pokePIC_Front_S.pack_forget()
    pokePIC_Back_S.pack_forget()
    pokePIC_frame.pack_forget()
    Data_Notebook.pack_forget()
    nameEN_Entr.pack_forget()
    nameEN_label.pack_forget()
    nameCN_Entr.pack_forget()
    nameCN_label.pack_forget()
    pokemon_NUM.pack_forget()

    Type_Normal.pack_forget()
    Type1_Normal_label.pack_forget()
    Type1_Normal.pack_forget()
    Type2_Normal_label.pack_forget()
    Type2_Normal.pack_forget()

    Egg_Normal.pack_forget()
    Egg1_Frame_Normal.pack_forget()
    Egg2_Frame_Normal.pack_forget()
    Egg1_Normal_label.pack_forget()
    Egg1_Normal.pack_forget()
    Egg2_Normal_label.pack_forget()
    Egg2_Normal.pack_forget()

    Color_Normal.pack_forget()
    Color_Normal_label.pack_forget()
    ColorMenu_Normal.pack_forget()

    bodilyForm_Normal.pack_forget()
    bodilyForm_Normal_label.pack_forget()
    bodilyFormMenu_Normal.pack_forget()

    LevelUpRare_Normal.pack_forget()
    LevelUpRare_Normal_label.pack_forget()
    LevelUpRareMenu_Normal.pack_forget()

    hatchRare_Normal.pack_forget()
    hatchRare_Normal_label.pack_forget()
    hatchRareMenu_Normal.pack_forget()

    catchRare_Normal.pack_forget()
    catchRare_Normal_label.pack_forget()
    catchRareBox_Normal.pack_forget()

    startFriendship_Normal.pack_forget()
    startFriendship_Normal_label.pack_forget()
    startFriendshipMenu_Normal.pack_forget()

    BallteData_Normal.pack_forget()
    baseStatsLabel_Normal.pack_forget()
    basePointsLabel_Normal.pack_forget()

    pokedex_Normal.pack_forget()
    pokedex_text_Normal.pack_forget()
    pokedex_label_Normal.pack_forget()

    baseStats_hp_Normal.pack_forget()
    baseStats_Normal_hp_label.pack_forget()
    baseStats_Normal_hp_Entr.pack_forget()
    baseStats_attack_Normal.pack_forget()
    baseStats_Normal_attack_label.pack_forget()
    baseStats_Normal_attack_Entr.pack_forget()
    baseStats_defense_Normal.pack_forget()
    baseStats_Normal_defense_label.pack_forget()
    baseStats_Normal_defense_Entr.pack_forget()
    baseStats_specialAttack_Normal.pack_forget()
    baseStats_Normal_specialAttack_label.pack_forget()
    baseStats_Normal_specialAttack_Entr.pack_forget()
    baseStats_specialDefense_Normal.pack_forget()
    baseStats_Normal_specialDefense_label.pack_forget()
    baseStats_Normal_specialDefense_Entr.pack_forget()
    baseStats_speed_Normal.pack_forget()
    baseStats_Normal_speed_label.pack_forget()
    baseStats_Normal_speed_Entr.pack_forget()

    basePoints_hp_Normal.pack_forget()
    basePoints_Normal_hp_label.pack_forget()
    basePoints_Normal_hp_Entr.pack_forget()
    basePoints_attack_Normal.pack_forget()
    basePoints_Normal_attack_label.pack_forget()
    basePoints_Normal_attack_Entr.pack_forget()
    basePoints_defense_Normal.pack_forget()
    basePoints_Normal_defense_label.pack_forget()
    basePoints_Normal_defense_Entr.pack_forget()
    basePoints_specialAttack_Normal.pack_forget()
    basePoints_Normal_specialAttack_label.pack_forget()
    basePoints_Normal_specialAttack_Entr.pack_forget()
    basePoints_specialDefense_Normal.pack_forget()
    basePoints_Normal_specialDefense_label.pack_forget()
    basePoints_Normal_specialDefense_Entr.pack_forget()
    basePoints_speed_Normal.pack_forget()
    basePoints_Normal_speed_label.pack_forget()
    basePoints_Normal_speed_Entr.pack_forget()

    Abilities_Normal.pack_forget()
    Abilities_1_Normal.pack_forget()
    Abilities_2_Normal.pack_forget()
    Abilities_3_Normal.pack_forget()
    Abilities1_Normal_label.pack_forget()
    AbilitiesMenu1_Normal.pack_forget()
    Abilities2_Normal_label.pack_forget()
    AbilitiesMenu2_Normal.pack_forget()
    Abilities3_Normal_label.pack_forget()
    AbilitiesMenu3_Normal.pack_forget()

    heightm_Normal.pack_forget()
    heightm_Normal_label.pack_forget()
    heightmBox_Normal.pack_forget()
    heightm_Normal_labelM.pack_forget()

    weightkg_Normal.pack_forget()
    weightkg_Normal_label.pack_forget()
    weightkgBox_Normal.pack_forget()
    weightkg_Normal_labelKG.pack_forget()

    pokeFormName_Normal.pack_forget()
    pokeFormName_label_Normal.pack_forget()
    pokeFormName_littleFrame_Normal.pack_forget()
    pokeFormName_Entr_Normal.pack_forget()

    pokekind_Normal.pack_forget()
    pokekind_label_Normal.pack_forget()
    pokekind_littleFrame_Normal.pack_forget()
    pokekind_Entr_Normal.pack_forget()
    pokekind_label2_Normal.pack_forget()

    genderTatio_Normal.pack_forget()
    genderTatio_Normal_label.pack_forget()
    genderTatioMenu_Normal.pack_forget()
    Data_Normal.pack_forget()
    Sep_Normal.pack_forget()
    frame_Normal_part_1.pack_forget()
    frame_Normal_part_2.pack_forget()
    '''
    太多太多了，，，
    '''
    Type_Alola.pack_forget()
    Type1_Alola_label.pack_forget()
    Type1_Alola.pack_forget()
    Type2_Alola_label.pack_forget()
    Type2_Alola.pack_forget()

    Egg_Alola.pack_forget()
    Egg1_Frame_Alola.pack_forget()
    Egg2_Frame_Alola.pack_forget()
    Egg1_Alola_label.pack_forget()
    Egg1_Alola.pack_forget()
    Egg2_Alola_label.pack_forget()
    Egg2_Alola.pack_forget()

    Color_Alola.pack_forget()
    Color_Alola_label.pack_forget()
    ColorMenu_Alola.pack_forget()

    bodilyForm_Alola.pack_forget()
    bodilyForm_Alola_label.pack_forget()
    bodilyFormMenu_Alola.pack_forget()

    LevelUpRare_Alola.pack_forget()
    LevelUpRare_Alola_label.pack_forget()
    LevelUpRareMenu_Alola.pack_forget()

    hatchRare_Alola.pack_forget()
    hatchRare_Alola_label.pack_forget()
    hatchRareMenu_Alola.pack_forget()

    catchRare_Alola.pack_forget()
    catchRare_Alola_label.pack_forget()
    catchRareBox_Alola.pack_forget()

    startFriendship_Alola.pack_forget()
    startFriendship_Alola_label.pack_forget()
    startFriendshipMenu_Alola.pack_forget()

    BallteData_Alola.pack_forget()
    baseStatsLabel_Alola.pack_forget()
    basePointsLabel_Alola.pack_forget()

    pokedex_Alola.pack_forget()
    pokedex_text_Alola.pack_forget()
    pokedex_label_Alola.pack_forget()

    baseStats_hp_Alola.pack_forget()
    baseStats_Alola_hp_label.pack_forget()
    baseStats_Alola_hp_Entr.pack_forget()
    baseStats_attack_Alola.pack_forget()
    baseStats_Alola_attack_label.pack_forget()
    baseStats_Alola_attack_Entr.pack_forget()
    baseStats_defense_Alola.pack_forget()
    baseStats_Alola_defense_label.pack_forget()
    baseStats_Alola_defense_Entr.pack_forget()
    baseStats_specialAttack_Alola.pack_forget()
    baseStats_Alola_specialAttack_label.pack_forget()
    baseStats_Alola_specialAttack_Entr.pack_forget()
    baseStats_specialDefense_Alola.pack_forget()
    baseStats_Alola_specialDefense_label.pack_forget()
    baseStats_Alola_specialDefense_Entr.pack_forget()
    baseStats_speed_Alola.pack_forget()
    baseStats_Alola_speed_label.pack_forget()
    baseStats_Alola_speed_Entr.pack_forget()

    basePoints_hp_Alola.pack_forget()
    basePoints_Alola_hp_label.pack_forget()
    basePoints_Alola_hp_Entr.pack_forget()
    basePoints_attack_Alola.pack_forget()
    basePoints_Alola_attack_label.pack_forget()
    basePoints_Alola_attack_Entr.pack_forget()
    basePoints_defense_Alola.pack_forget()
    basePoints_Alola_defense_label.pack_forget()
    basePoints_Alola_defense_Entr.pack_forget()
    basePoints_specialAttack_Alola.pack_forget()
    basePoints_Alola_specialAttack_label.pack_forget()
    basePoints_Alola_specialAttack_Entr.pack_forget()
    basePoints_specialDefense_Alola.pack_forget()
    basePoints_Alola_specialDefense_label.pack_forget()
    basePoints_Alola_specialDefense_Entr.pack_forget()
    basePoints_speed_Alola.pack_forget()
    basePoints_Alola_speed_label.pack_forget()
    basePoints_Alola_speed_Entr.pack_forget()

    Abilities_Alola.pack_forget()
    Abilities_1_Alola.pack_forget()
    Abilities_2_Alola.pack_forget()
    Abilities_3_Alola.pack_forget()
    Abilities1_Alola_label.pack_forget()
    AbilitiesMenu1_Alola.pack_forget()
    Abilities2_Alola_label.pack_forget()
    AbilitiesMenu2_Alola.pack_forget()
    Abilities3_Alola_label.pack_forget()
    AbilitiesMenu3_Alola.pack_forget()

    heightm_Alola.pack_forget()
    heightm_Alola_label.pack_forget()
    heightmBox_Alola.pack_forget()
    heightm_Alola_labelM.pack_forget()

    weightkg_Alola.pack_forget()
    weightkg_Alola_label.pack_forget()
    weightkgBox_Alola.pack_forget()
    weightkg_Alola_labelKG.pack_forget()

    pokeFormName_Alola.pack_forget()
    pokeFormName_label_Alola.pack_forget()
    pokeFormName_littleFrame_Alola.pack_forget()
    pokeFormName_Entr_Alola.pack_forget()

    pokekind_Alola.pack_forget()
    pokekind_label_Alola.pack_forget()
    pokekind_littleFrame_Alola.pack_forget()
    pokekind_Entr_Alola.pack_forget()
    pokekind_label2_Alola.pack_forget()

    genderTatio_Alola.pack_forget()
    genderTatio_Alola_label.pack_forget()
    genderTatioMenu_Alola.pack_forget()
    Data_Alola.pack_forget()
    Sep_Alola.pack_forget()
    frame_Alola_part_1.pack_forget()
    frame_Alola_part_2.pack_forget()
    '''阿罗拉清除'''
    Type_Galar.pack_forget()
    Type1_Galar_label.pack_forget()
    Type1_Galar.pack_forget()
    Type2_Galar_label.pack_forget()
    Type2_Galar.pack_forget()

    Egg_Galar.pack_forget()
    Egg1_Frame_Galar.pack_forget()
    Egg2_Frame_Galar.pack_forget()
    Egg1_Galar_label.pack_forget()
    Egg1_Galar.pack_forget()
    Egg2_Galar_label.pack_forget()
    Egg2_Galar.pack_forget()

    Color_Galar.pack_forget()
    Color_Galar_label.pack_forget()
    ColorMenu_Galar.pack_forget()

    bodilyForm_Galar.pack_forget()
    bodilyForm_Galar_label.pack_forget()
    bodilyFormMenu_Galar.pack_forget()

    LevelUpRare_Galar.pack_forget()
    LevelUpRare_Galar_label.pack_forget()
    LevelUpRareMenu_Galar.pack_forget()

    hatchRare_Galar.pack_forget()
    hatchRare_Galar_label.pack_forget()
    hatchRareMenu_Galar.pack_forget()

    catchRare_Galar.pack_forget()
    catchRare_Galar_label.pack_forget()
    catchRareBox_Galar.pack_forget()

    startFriendship_Galar.pack_forget()
    startFriendship_Galar_label.pack_forget()
    startFriendshipMenu_Galar.pack_forget()

    BallteData_Galar.pack_forget()
    baseStatsLabel_Galar.pack_forget()
    basePointsLabel_Galar.pack_forget()

    pokedex_Galar.pack_forget()
    pokedex_text_Galar.pack_forget()
    pokedex_label_Galar.pack_forget()

    baseStats_hp_Galar.pack_forget()
    baseStats_Galar_hp_label.pack_forget()
    baseStats_Galar_hp_Entr.pack_forget()
    baseStats_attack_Galar.pack_forget()
    baseStats_Galar_attack_label.pack_forget()
    baseStats_Galar_attack_Entr.pack_forget()
    baseStats_defense_Galar.pack_forget()
    baseStats_Galar_defense_label.pack_forget()
    baseStats_Galar_defense_Entr.pack_forget()
    baseStats_specialAttack_Galar.pack_forget()
    baseStats_Galar_specialAttack_label.pack_forget()
    baseStats_Galar_specialAttack_Entr.pack_forget()
    baseStats_specialDefense_Galar.pack_forget()
    baseStats_Galar_specialDefense_label.pack_forget()
    baseStats_Galar_specialDefense_Entr.pack_forget()
    baseStats_speed_Galar.pack_forget()
    baseStats_Galar_speed_label.pack_forget()
    baseStats_Galar_speed_Entr.pack_forget()

    basePoints_hp_Galar.pack_forget()
    basePoints_Galar_hp_label.pack_forget()
    basePoints_Galar_hp_Entr.pack_forget()
    basePoints_attack_Galar.pack_forget()
    basePoints_Galar_attack_label.pack_forget()
    basePoints_Galar_attack_Entr.pack_forget()
    basePoints_defense_Galar.pack_forget()
    basePoints_Galar_defense_label.pack_forget()
    basePoints_Galar_defense_Entr.pack_forget()
    basePoints_specialAttack_Galar.pack_forget()
    basePoints_Galar_specialAttack_label.pack_forget()
    basePoints_Galar_specialAttack_Entr.pack_forget()
    basePoints_specialDefense_Galar.pack_forget()
    basePoints_Galar_specialDefense_label.pack_forget()
    basePoints_Galar_specialDefense_Entr.pack_forget()
    basePoints_speed_Galar.pack_forget()
    basePoints_Galar_speed_label.pack_forget()
    basePoints_Galar_speed_Entr.pack_forget()

    Abilities_Galar.pack_forget()
    Abilities_1_Galar.pack_forget()
    Abilities_2_Galar.pack_forget()
    Abilities_3_Galar.pack_forget()
    Abilities1_Galar_label.pack_forget()
    AbilitiesMenu1_Galar.pack_forget()
    Abilities2_Galar_label.pack_forget()
    AbilitiesMenu2_Galar.pack_forget()
    Abilities3_Galar_label.pack_forget()
    AbilitiesMenu3_Galar.pack_forget()

    heightm_Galar.pack_forget()
    heightm_Galar_label.pack_forget()
    heightmBox_Galar.pack_forget()
    heightm_Galar_labelM.pack_forget()

    weightkg_Galar.pack_forget()
    weightkg_Galar_label.pack_forget()
    weightkgBox_Galar.pack_forget()
    weightkg_Galar_labelKG.pack_forget()

    pokeFormName_Galar.pack_forget()
    pokeFormName_label_Galar.pack_forget()
    pokeFormName_littleFrame_Galar.pack_forget()
    pokeFormName_Entr_Galar.pack_forget()

    pokekind_Galar.pack_forget()
    pokekind_label_Galar.pack_forget()
    pokekind_littleFrame_Galar.pack_forget()
    pokekind_Entr_Galar.pack_forget()
    pokekind_label2_Galar.pack_forget()

    genderTatio_Galar.pack_forget()
    genderTatio_Galar_label.pack_forget()
    genderTatioMenu_Galar.pack_forget()
    Data_Galar.pack_forget()
    Sep_Galar.pack_forget()
    frame_Galar_part_1.pack_forget()
    frame_Galar_part_2.pack_forget()
    '''伽勒尔'''

def use_pack():
    pokedex_frame.pack()
    Normal_diffFrame.pack(anchor='nw')
    Alola_diffFrame.pack(anchor=tkinter.NW, expand=tkinter.YES)
    Galar_diffFrame.pack(anchor=tkinter.NW, expand=tkinter.YES)
    Normal_diff_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Normal_diff.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Normal_diff_Button.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Alola_diff_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Alola_diff.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Alola_diff_Button.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Galar_diff_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Galar_diff.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Galar_diff_Button.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Sep_Normal.pack(fill='x',pady=5)
    Data_Normal.pack()
    frame_Normal_part_1.pack(side='left' ,expand=tkinter.YES,padx=5)
    frame_Normal_part_2.pack(side='left', expand=tkinter.YES,padx=5)
    pokeFormName_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_label_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_littleFrame_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_Entr_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    pokekind_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    pokekind_label_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_littleFrame_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_Entr_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_label2_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    Type_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    Type1_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type1_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type2_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type2_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    genderTatio_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    genderTatio_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    genderTatioMenu_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    BallteData_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    baseStatsLabel_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePointsLabel_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    baseStats_hp_Normal.pack()
    baseStats_Normal_hp_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Normal_hp_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_attack_Normal.pack()
    baseStats_Normal_attack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Normal_attack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_defense_Normal.pack()
    baseStats_Normal_defense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Normal_defense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_specialAttack_Normal.pack()
    baseStats_Normal_specialAttack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Normal_specialAttack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_specialDefense_Normal.pack()
    baseStats_Normal_specialDefense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Normal_specialDefense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_speed_Normal.pack()
    baseStats_Normal_speed_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Normal_speed_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)

    basePoints_hp_Normal.pack()
    basePoints_Normal_hp_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Normal_hp_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_attack_Normal.pack()
    basePoints_Normal_attack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Normal_attack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_defense_Normal.pack()
    basePoints_Normal_defense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Normal_defense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_specialAttack_Normal.pack()
    basePoints_Normal_specialAttack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Normal_specialAttack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_specialDefense_Normal.pack()
    basePoints_Normal_specialDefense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Normal_specialDefense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_speed_Normal.pack()
    basePoints_Normal_speed_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Normal_speed_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)

    Abilities_Normal.pack(anchor=tkinter.W)
    Abilities_1_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities_2_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities_3_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities1_Normal_label.pack(side='left',expand=tkinter.YES)
    AbilitiesMenu1_Normal.pack(side='left',expand=tkinter.YES)
    Abilities2_Normal_label.pack(side='left',expand=tkinter.YES)
    AbilitiesMenu2_Normal.pack(side='left',expand=tkinter.YES)
    Abilities3_Normal_label.pack(side='left',expand=tkinter.YES)
    AbilitiesMenu3_Normal.pack(side='left',expand=tkinter.YES)

    LevelUpRare_Normal.pack(anchor=tkinter.W)
    LevelUpRare_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    LevelUpRareMenu_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    catchRare_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    catchRare_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    catchRareBox_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    pokedex_Normal.pack()
    pokedex_label_Normal.pack(anchor=tkinter.NW, expand=tkinter.YES)
    pokedex_text_Normal.pack(anchor=tkinter.S)

    startFriendship_Normal.pack(anchor=tkinter.W)
    startFriendship_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    startFriendshipMenu_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    hatchRare_Normal.pack(anchor=tkinter.W)
    hatchRare_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    hatchRareMenu_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    Egg_Normal.pack(anchor=tkinter.W)
    Egg1_Frame_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Frame_Normal.pack( anchor=tkinter.W, expand=tkinter.YES)
    Egg1_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg1_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    heightm_Normal.pack(anchor=tkinter.W)
    heightm_Normal_label.pack(side='left', expand=tkinter.YES)
    heightmBox_Normal.pack(side='left', expand=tkinter.YES)
    heightm_Normal_labelM.pack(side='left', expand=tkinter.YES)

    weightkg_Normal.pack(anchor=tkinter.W)
    weightkg_Normal_label.pack(side='left', expand=tkinter.YES)
    weightkgBox_Normal.pack(side='left', expand=tkinter.YES)
    weightkg_Normal_labelKG.pack(side='left', expand=tkinter.YES)

    Color_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    Color_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    ColorMenu_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    bodilyForm_Normal.pack(anchor=tkinter.W, expand=tkinter.YES)
    bodilyForm_Normal_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    bodilyFormMenu_Normal.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    '''
    一般形态集合，好庞大了现在
    '''
    Sep_Alola.pack(fill='x', pady=5)
    Data_Alola.pack()
    frame_Alola_part_1.pack(side='left', expand=tkinter.YES, padx=5)
    frame_Alola_part_2.pack(side='left', expand=tkinter.YES, padx=5)
    pokeFormName_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_label_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_littleFrame_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_Entr_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    pokekind_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    pokekind_label_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_littleFrame_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_Entr_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_label2_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    Type_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Type1_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type1_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type2_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type2_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    genderTatio_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    genderTatio_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    genderTatioMenu_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    BallteData_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    baseStatsLabel_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePointsLabel_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    baseStats_hp_Alola.pack()
    baseStats_Alola_hp_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Alola_hp_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_attack_Alola.pack()
    baseStats_Alola_attack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Alola_attack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_defense_Alola.pack()
    baseStats_Alola_defense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Alola_defense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_specialAttack_Alola.pack()
    baseStats_Alola_specialAttack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Alola_specialAttack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_specialDefense_Alola.pack()
    baseStats_Alola_specialDefense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Alola_specialDefense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_speed_Alola.pack()
    baseStats_Alola_speed_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Alola_speed_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)

    basePoints_hp_Alola.pack()
    basePoints_Alola_hp_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Alola_hp_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_attack_Alola.pack()
    basePoints_Alola_attack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Alola_attack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_defense_Alola.pack()
    basePoints_Alola_defense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Alola_defense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_specialAttack_Alola.pack()
    basePoints_Alola_specialAttack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Alola_specialAttack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_specialDefense_Alola.pack()
    basePoints_Alola_specialDefense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Alola_specialDefense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_speed_Alola.pack()
    basePoints_Alola_speed_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Alola_speed_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)

    Abilities_Alola.pack(anchor=tkinter.W)
    Abilities_1_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities_2_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities_3_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities1_Alola_label.pack(side='left', expand=tkinter.YES)
    AbilitiesMenu1_Alola.pack(side='left', expand=tkinter.YES)
    Abilities2_Alola_label.pack(side='left', expand=tkinter.YES)
    AbilitiesMenu2_Alola.pack(side='left', expand=tkinter.YES)
    Abilities3_Alola_label.pack(side='left', expand=tkinter.YES)
    AbilitiesMenu3_Alola.pack(side='left', expand=tkinter.YES)

    LevelUpRare_Alola.pack(anchor=tkinter.W)
    LevelUpRare_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    LevelUpRareMenu_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    catchRare_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    catchRare_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    catchRareBox_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    pokedex_Alola.pack()
    pokedex_label_Alola.pack(anchor=tkinter.NW, expand=tkinter.YES)
    pokedex_text_Alola.pack(anchor=tkinter.S)

    startFriendship_Alola.pack(anchor=tkinter.W)
    startFriendship_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    startFriendshipMenu_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    hatchRare_Alola.pack(anchor=tkinter.W)
    hatchRare_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    hatchRareMenu_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    Egg_Alola.pack(anchor=tkinter.W)
    Egg1_Frame_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Frame_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Egg1_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg1_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    heightm_Alola.pack(anchor=tkinter.W)
    heightm_Alola_label.pack(side='left', expand=tkinter.YES)
    heightmBox_Alola.pack(side='left', expand=tkinter.YES)
    heightm_Alola_labelM.pack(side='left', expand=tkinter.YES)

    weightkg_Alola.pack(anchor=tkinter.W)
    weightkg_Alola_label.pack(side='left', expand=tkinter.YES)
    weightkgBox_Alola.pack(side='left', expand=tkinter.YES)
    weightkg_Alola_labelKG.pack(side='left', expand=tkinter.YES)

    Color_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    Color_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    ColorMenu_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    bodilyForm_Alola.pack(anchor=tkinter.W, expand=tkinter.YES)
    bodilyForm_Alola_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    bodilyFormMenu_Alola.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    '''
    阿罗拉上线测试中
    '''
    Sep_Galar.pack(fill='x',pady=5)
    Data_Galar.pack()
    frame_Galar_part_1.pack(side='left' ,expand=tkinter.YES,padx=5)
    frame_Galar_part_2.pack(side='left', expand=tkinter.YES,padx=5)
    pokeFormName_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_label_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_littleFrame_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokeFormName_Entr_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    pokekind_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    pokekind_label_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_littleFrame_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_Entr_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    pokekind_label2_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    Type_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    Type1_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type1_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type2_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Type2_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    genderTatio_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    genderTatio_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    genderTatioMenu_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    BallteData_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    baseStatsLabel_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePointsLabel_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    baseStats_hp_Galar.pack()
    baseStats_Galar_hp_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Galar_hp_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_attack_Galar.pack()
    baseStats_Galar_attack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Galar_attack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_defense_Galar.pack()
    baseStats_Galar_defense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Galar_defense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_specialAttack_Galar.pack()
    baseStats_Galar_specialAttack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Galar_specialAttack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_specialDefense_Galar.pack()
    baseStats_Galar_specialDefense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Galar_specialDefense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_speed_Galar.pack()
    baseStats_Galar_speed_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    baseStats_Galar_speed_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)

    basePoints_hp_Galar.pack()
    basePoints_Galar_hp_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Galar_hp_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_attack_Galar.pack()
    basePoints_Galar_attack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Galar_attack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_defense_Galar.pack()
    basePoints_Galar_defense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Galar_defense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_specialAttack_Galar.pack()
    basePoints_Galar_specialAttack_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Galar_specialAttack_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_specialDefense_Galar.pack()
    basePoints_Galar_specialDefense_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Galar_specialDefense_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_speed_Galar.pack()
    basePoints_Galar_speed_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    basePoints_Galar_speed_Entr.pack(side='right', anchor=tkinter.W, expand=tkinter.YES)

    Abilities_Galar.pack(anchor=tkinter.W)
    Abilities_1_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities_2_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities_3_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    Abilities1_Galar_label.pack(side='left',expand=tkinter.YES)
    AbilitiesMenu1_Galar.pack(side='left',expand=tkinter.YES)
    Abilities2_Galar_label.pack(side='left',expand=tkinter.YES)
    AbilitiesMenu2_Galar.pack(side='left',expand=tkinter.YES)
    Abilities3_Galar_label.pack(side='left',expand=tkinter.YES)
    AbilitiesMenu3_Galar.pack(side='left',expand=tkinter.YES)

    LevelUpRare_Galar.pack(anchor=tkinter.W)
    LevelUpRare_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    LevelUpRareMenu_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    catchRare_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    catchRare_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    catchRareBox_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    pokedex_Galar.pack()
    pokedex_label_Galar.pack(anchor=tkinter.NW, expand=tkinter.YES)
    pokedex_text_Galar.pack(anchor=tkinter.S)

    startFriendship_Galar.pack(anchor=tkinter.W)
    startFriendship_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    startFriendshipMenu_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    hatchRare_Galar.pack(anchor=tkinter.W)
    hatchRare_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    hatchRareMenu_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    Egg_Galar.pack(anchor=tkinter.W)
    Egg1_Frame_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Frame_Galar.pack( anchor=tkinter.W, expand=tkinter.YES)
    Egg1_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg1_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    Egg2_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    heightm_Galar.pack(anchor=tkinter.W)
    heightm_Galar_label.pack(side='left', expand=tkinter.YES)
    heightmBox_Galar.pack(side='left', expand=tkinter.YES)
    heightm_Galar_labelM.pack(side='left', expand=tkinter.YES)

    weightkg_Galar.pack(anchor=tkinter.W)
    weightkg_Galar_label.pack(side='left', expand=tkinter.YES)
    weightkgBox_Galar.pack(side='left', expand=tkinter.YES)
    weightkg_Galar_labelKG.pack(side='left', expand=tkinter.YES)

    Color_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    Color_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    ColorMenu_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)

    bodilyForm_Galar.pack(anchor=tkinter.W, expand=tkinter.YES)
    bodilyForm_Galar_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    bodilyFormMenu_Galar.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    '''
    伽勒尔上线测试中
    '''
    pokemon_NUM.pack(side='left')
    pokeNUMNAM_frame.pack(side='left', anchor=tkinter.NW)
    pokeNUM_frame.pack(anchor=tkinter.W,expand=tkinter.YES, fill=tkinter.X)
    pokeNAMC_frame.pack()
    pokeNAME_frame.pack()
    nameCN_label.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    nameCN_Entr.pack(side='left', anchor=tkinter.W, expand=tkinter.YES)
    nameEN_label.pack(side='left', anchor=tkinter.SW, expand=tkinter.YES)
    nameEN_Entr.pack(side='left', anchor=tkinter.SW, expand=tkinter.YES)
    pokePIC_Ico.pack(side='left')
    pokePIC_Front.pack(side='left',anchor=tkinter.N)
    pokePIC_Back.pack(anchor=tkinter.N)
    showPack()
    pokePIC_Front_S.pack(side='left',anchor=tkinter.N)
    pokePIC_Back_S.pack(anchor=tkinter.N)
    pokePIC_label.pack(anchor=tkinter.N, expand=tkinter.YES)
    pokePIC_diff_frame.pack(anchor=tkinter.N)
    pokePICdiffTypeFrame.pack()
    pokePICdiffFrame.pack()
    pokePIC_diff_Type_label.pack(side='left',anchor=tkinter.N)
    pokePIC_diff_Type.pack(side='left',anchor=tkinter.N)
    pokePIC_diff_label.pack(side='left',anchor=tkinter.N)
    pokePIC_diff.pack(side='left',anchor=tkinter.N)
    pokePIC_Normal.pack(ipady=0, expand=tkinter.YES,anchor=tkinter.N)
    pokePIC_Normal_label.pack(ipady=0, expand=tkinter.YES,anchor=tkinter.N)
    pokePIC_shine.pack(ipady=0, expand=tkinter.YES,anchor=tkinter.N)
    pokePIC_Shine_label.pack(ipady=0, expand=tkinter.YES,anchor=tkinter.N)
    pokePIC_battle.pack(side='left')
    pokePIC_frame.pack()
    pokedex_top.pack()
    #
    Alola_diff.pack()
    #
    Galar_diff.pack()
    #
    Data_Notebook.pack(side='left', anchor=tkinter.W, expand=tkinter.YES, fill=tkinter.X)
    pokedex_bottom.pack()
    pokeNUMNAM_frame.pack()

def checkFormDiff(No):
    show_diff()

def check_diff(No):
    #diffListUpdate()
    pokemon_create()
    show_diff()
    show_BattleData()
    check_battleData()

def show_diff():
    global diff_var
    global pokePIC_diff
    global area
    pokemon_data = pokemon_dataList['pokemon_list']
    print(pokemon_data)
    num = main.check_pokemon_data(now_gen, check_num)
    temp12 = pokemon_data[num]
    pokemonItem = temp12[area]
    if area=='Normal':
        temp_lost = pokemonItem[str(diff_value_1.get())]
        get_pic(Forms)
    elif area=='Alola':
        temp_lost = pokemonItem[str(diff_value_2.get())]
        get_pic(Forms)
    else:
        temp_lost = pokemonItem[str(diff_value_3.get())]
        get_pic(Forms)

def change_list_Formes(event):
    top.attributes("-disabled", 1)
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    temp12 = pokemon_data[num]
    pokemonItem = temp12[area]
    change_list_FormesWin=tkinter.Tk()
    change_list_FormesWin.title('修改形态序列')
    def my_close():
        top.attributes("-disabled", 0)
        change_list_FormesWin.destroy()

    change_list_FormesWin.protocol('WM_DELETE_WINDOW', my_close)
    Listbox=tkinter.Listbox(change_list_FormesWin)
    Key = list(pokemonItem.keys())
    lenNum = len(Key)
    for i in range(lenNum):
        item_1=str(Key[i])
        Listbox.insert(tkinter.END,item_1)
    Listbox.pack(side=tkinter.LEFT, fill=tkinter.BOTH)
    No_Label=tkinter.Label(change_list_FormesWin,text='编号')
    No=tkinter.Entry(change_list_FormesWin)
    def InsertnewData():
        item = str(No.get())
        Listbox.insert(tkinter.END, item)
    def commit():
        global diff_var
        global pokePIC_diff
        global NO_diff
        # print(NO_diff)
        oldlist = Listbox.get(0, 1000)
        checkLen=len(oldlist)-1
        NewLen=len(pokemon_Item)
        i=len(pokemonItem)
        while i <=checkLen:
                print(i)
                pokemonItem[str(i)] = pokemon.copy()
                temp12[area] = pokemonItem
                pokemon_data[num] = temp12
                print('test')
                print(temp12[area])
                pokemon_dataList['pokemon_list'] = pokemon_data
                i += 1
        temp12[area] = pokemonItem
        pokemon_data[num] = temp12
        pokemon_dataList['pokemon_list'] = pokemon_data
        diffListUpdate()
        top.attributes("-disabled", 0)
        change_list_FormesWin.destroy()
    InsertButton = tkinter.Button(change_list_FormesWin, text='添加', command=InsertnewData)
    commitButton = tkinter.Button(change_list_FormesWin, text='更新', command=commit)
    No_Label.pack()
    No.pack()
    InsertButton.pack()
    commitButton.pack()

def changeFormTypeDiff(lists):
    updateData = json.load(open('./res/resData.json', encoding='utf-8'))
    resData = updateData['res']
    goalData=resData['formsDiff']
    global diff_var
    global pokePIC_diff
    global area
    pokemon_data = pokemon_dataList['pokemon_list']
    print(pokemon_data)
    num = main.check_pokemon_data(now_gen, check_num)
    temp12 = pokemon_data[num]
    pokemonItem = temp12[area]
    if area == 'Normal':
        temp_lost = pokemonItem[str(diff_value_1.get())]
        FormsType = temp_lost['formsType']
        Forms1 = resData[FormsType]
        formlist=list(goalData.keys())
        for item in formlist:
            if goalData[item] == diff_Type_value.get():
                print(item)
                Forms1 = resData[item]
                print(Forms1)
                break
        new_menu_1 =list(goalData.values())
        pokePIC_diff_Type.set_menu('',*new_menu_1)
        new_menu = list(Forms1.values())
        pokePIC_diff.set_menu('', *new_menu)
        diff_value.set(new_menu[0])
    elif area == 'Alola':
        temp_lost = pokemonItem[str(diff_value_2.get())]
        FormsType = temp_lost['formsType']
        Forms1=temp_lost['forms']
        for item in list(goalData.keys()):
            if goalData[item] == diff_Type_value.get():
                Forms1 = resData[item]
                break
        print(Forms1)
        new_menu_1 = list(goalData.values())
        new_menu_1 = list(goalData.values())
        pokePIC_diff_Type.set_menu('', *new_menu_1)
        new_menu = list(Forms1.values())
        pokePIC_diff.set_menu('', *new_menu)
        new_menu[0]
    else:
        temp_lost = pokemonItem[str(diff_value_3.get())]
        FormsType = temp_lost['formsType']
        for item in list(goalData.keys()):
            if goalData[item] == diff_Type_value.get():
                temp = item
                break
        Forms1 = resData[temp]
        print(Forms1)
        new_menu_1 = list(goalData.values())
        new_menu_1 = list(goalData.values())
        pokePIC_diff_Type.set_menu('', *new_menu_1)
        new_menu = list(Forms1.values())
        pokePIC_diff.set_menu('', *new_menu)
        new_menu[0]

def update():
    global check_num
    check_num=0
    minMenu.delete(0,100)
    for i in range(len(get_gen_list())):
        name=get_gen_list()[i]
        #print(name)
        minMenu.add_command(label=name,command= lambda gen=name:openlist(gen))

def typeChange(type1):
    typeEN=list(types.keys())
    print(typeEN)
    for item in typeEN:
        if type1==types[item]:
            return item
            break
        else:
            continue

def EggChange(Egg1):
    EggEN=list(Eggs.keys())
    print(EggEN)
    for item in EggEN:
        if Egg1==Eggs[item]:
            return item
            break
        else:
            continue

def ColorChange(Color):
    ColorEN=list(Colors.keys())
    print(ColorEN)
    for item in ColorEN:
        if Color==Colors[item]:
            return item
            break
        else:
            continue

def bodilyFormChange(bodilyForm):
    bodilyFormEN=list(bodilyForms.keys())
    print(bodilyFormEN)
    for item in bodilyFormEN:
        if bodilyForm==bodilyForms[item]:
            return item
            break
        else:
            continue

def LevelUpRareChange(LevelUpRare):
    LevelUpRareEN=list(LevelUpRares.keys())
    print(LevelUpRareEN)
    for item in LevelUpRareEN:
        if LevelUpRare==LevelUpRares[item]:
            return item
            break
        else:
            continue

def AbilitiesChange(ability):
    AbilitiesEN = list(Abilities.keys())
    for item in AbilitiesEN:
        if ability == Abilities[item]:
            return item
            break
        else:
            continue

def genderTatioChange(genderTatio1):
    genderTatioEN = list(genderTatios.keys())
    for item in genderTatioEN:
        if genderTatio1 == genderTatios[item]:
            return item
            break
        else:
            continue

def save():
    global NO_diff
    global now_gen
    global check_num
    global pokemon_dataList
    global area
    global diff_value_1
    global diff_values_1
    global Normal_diff
    global pokeDataRes
    global diffTypeStat
    pokemon_data = pokemon_dataList['pokemon_list']
    num = main.check_pokemon_data(now_gen, check_num)
    print(num)
    pokemonSelfdata=pokemon_data[num]
    print(pokemonSelfdata)
    pokemonSelfdata['species']=nameEN_Entr.get()
    pokemonSelfdata['speciesChinese'] =nameCN_Entr.get()

    diffTypeCN=list(diffTypeStat.values())
    diffTypeEN = list(diffTypeStat.keys())

    pokemonAreadata = pokemonSelfdata[area]
    if area == 'Normal':
        pokemonSelf_data = pokemonAreadata[diff_value_1.get()]
    elif area == 'Alola':
        pokemonSelf_data = pokemonAreadata[diff_value_2.get()]
    else:
        pokemonSelf_data = pokemonAreadata[diff_value_3.get()]

    if area=='Normal':
        if pokemFormNameString_Normal.get() == 'No_nickName':
            pokemonSelf_data['formesName'] = ''
        else:
            pokemonSelf_data['formesName'] = pokemFormNameString_Normal.get()
        if pokekindString_Normal.get() == '<请填入类型>':
            pokemonSelf_data['kind'] = ''
        else:
            pokemonSelf_data['kind'] = pokekindString_Normal.get()

        for item1 in diffTypeEN:
            if diffTypeStat[item1]==diff_Type_value.get():
                pokemonSelf_data['formsType']=item1
                temp=pokeDataRes[item1]
                tempData=list(temp.keys())
                i=0
                temp2=pokemonSelf_data['forms']
                temp2={}
                for item2 in tempData:
                    temp2[str(i)] = item2
                    i+=1
                pokemonSelf_data['forms']=temp2
                break

        pokemonbaseStats = pokemonSelf_data['baseStats']
        pokemonbaseStats['hp'] = int(baseStats_Normal_hp_Entr.get())
        pokemonbaseStats['attack'] = int(baseStats_Normal_attack_Entr.get())
        pokemonbaseStats['specialAttack'] = int(baseStats_Normal_specialAttack_Entr.get())
        pokemonbaseStats['specialDefense'] = int(baseStats_Normal_specialDefense_Entr.get())
        pokemonbaseStats['defense'] = int(baseStats_Normal_defense_Entr.get())
        pokemonbaseStats['speed'] = int(baseStats_Normal_speed_Entr.get())

        pokemonbasePoints = pokemonSelf_data['basePoints']
        pokemonbasePoints['hp'] = int(basePoints_Normal_hp_Entr.get())
        pokemonbasePoints['attack'] = int(basePoints_Normal_attack_Entr.get())
        pokemonbasePoints['specialAttack'] = int(basePoints_Normal_specialAttack_Entr.get())
        pokemonbasePoints['specialDefense'] = int(basePoints_Normal_specialDefense_Entr.get())
        pokemonbasePoints['defense'] = int(basePoints_Normal_defense_Entr.get())
        pokemonbasePoints['speed'] = int(basePoints_Normal_speed_Entr.get())

        pokemonSelf_data['baseStats'] = pokemonbaseStats
        pokemonSelf_data['basePoints'] = pokemonbasePoints
        # 种族值与基础点数更新
        pokemonSelf_data['catchRare'] = int(catchRareBox_Normal.get())
        # 捕获率更新
        pokemonSelf_data['heightm'] = float(heightmBox_Normal.get())
        pokemonSelf_data['weightkg'] = float(weightkgBox_Normal.get())
        # 身高体重更新
        if pokedex_text_Normal.get('0.0', 'end').strip('\n') == '<请输入内容>':
            pokemonSelf_data['pokedex'] = ''
        else:
            pokemonSelf_data['pokedex'] = pokedex_text_Normal.get('0.0', 'end').rstrip()

        if typeList1_Normal.get() == 'none':
            pokemonSelf_data['types'] = []
        else:
            if typeList2_Normal.get() == 'none':
                pokemonSelf_data['types'] = [typeChange(typeList1_Normal.get())]
            else:
                pokemonSelf_data['types'] = [typeChange(typeList1_Normal.get()), typeChange(typeList2_Normal.get())]
        # 属性更新
        if EggList1_Normal.get() == 'none':
            pokemonSelf_data['eggGroups'] = []
        else:
            if EggList2_Normal.get() == 'none':
                pokemonSelf_data['eggGroups'] = [EggChange(EggList1_Normal.get())]
            else:
                pokemonSelf_data['eggGroups'] = [EggChange(EggList1_Normal.get()), EggChange(EggList2_Normal.get())]
        # 蛋组更新
        if ColorList_Normal.get() == 'none':
            pokemonSelf_data['color'] = ''
        else:
            pokemonSelf_data['color'] = ColorChange(ColorList_Normal.get())
        # 颜色更新
        if genderTatioList_Normal.get() == 'none':
            pokemonSelf_data['genderTatio'] = ''
        else:
            print(genderTatioChange(genderTatioList_Normal.get()))
            genderTatioFind = list(genderTatioChange(genderTatioList_Normal.get()))
            pokemonSelf_data['genderTatio'] = [int(genderTatioFind[1]), int(genderTatioFind[3])]
        # 性别更新
        if bodilyFormList_Normal.get() == 'none':
            pokemonSelf_data['bodilyForm'] = ''
        else:
            pokemonSelf_data['bodilyForm'] = bodilyFormChange(bodilyFormList_Normal.get())
        # 体型更新
        if LevelUpRareList_Normal.get() == 'none':
            pokemonSelf_data['levelupRare'] = ''
        else:
            pokemonSelf_data['levelupRare'] = LevelUpRareChange(LevelUpRareList_Normal.get())
        # 升级速率更新
        if hatchRareList_Normal.get() == 'none':
            pokemonSelf_data['hatchRare'] = ''
        else:
            pokemonSelf_data['hatchRare'] = hatchRareList_Normal.get()
        # 孵化周期更新
        if startFriendshipList_Normal.get() == 'none':
            pokemonSelf_data['startFriendship'] = ''
        else:
            pokemonSelf_data['startFriendship'] = startFriendshipList_Normal.get()
        # 初始亲密度更新
        pokemonSelf_dataAbilities = pokemonSelf_data['abilities']
        if AbilitiesMenu1_Normal.get() == 'none':
            pokemonSelf_dataAbilities['0'] = 'none'
        else:
            pokemonSelf_dataAbilities['0'] = AbilitiesChange(AbilitiesMenu1_Normal.get())
        if AbilitiesMenu2_Normal.get() == 'none':
            pokemonSelf_dataAbilities['1'] = 'none'
        else:
            pokemonSelf_dataAbilities['1'] = AbilitiesChange(AbilitiesMenu2_Normal.get())
        if AbilitiesMenu3_Normal.get() == 'none':
            pokemonSelf_dataAbilities['H'] = 'none'
        else:
            pokemonSelf_dataAbilities['H'] = AbilitiesChange(AbilitiesMenu3_Normal.get())
        pokemonSelf_data['abilities'] = pokemonSelf_dataAbilities
        # 特性更新
        pokemonAreadata[diff_value_1.get()] = pokemonSelf_data
        pokemonSelfdata[area] = pokemonAreadata
        print(pokemonAreadata)
        pokemon_data[num] = pokemonSelfdata
        pokemon_dataList['pokemon_list'] = pokemon_data
        jsondata = json.dumps(pokemon_dataList, ensure_ascii=False, indent=4, separators=(',', ':'))
        f = open('./pokemon_data/' + now_gen + '/pokemon.json', 'w', encoding='utf-8')
        f.write(jsondata)
        f.close()
    elif area=='Alola':
        if pokemFormNameString_Alola.get() == 'No_nickName':
            pokemonSelf_data['formesName'] = ''
        else:
            pokemonSelf_data['formesName'] = pokemFormNameString_Alola.get()
        if pokekindString_Alola.get() == '<请填入类型>':
            pokemonSelf_data['kind'] = ''
        else:
            pokemonSelf_data['kind'] = pokekindString_Alola.get()

        for item1 in diffTypeEN:
            if diffTypeStat[item1]==diff_Type_value.get():
                pokemonSelf_data['formsType']=item1
                temp=pokeDataRes[item1]
                tempData=list(temp.keys())
                i=0
                temp2=pokemonSelf_data['forms']
                temp2={}
                for item2 in tempData:
                    temp2[str(i)] = item2
                    i+=1
                pokemonSelf_data['forms']=temp2
                break

        pokemonbaseStats = pokemonSelf_data['baseStats']
        pokemonbaseStats['hp'] = int(baseStats_Alola_hp_Entr.get())
        pokemonbaseStats['attack'] = int(baseStats_Alola_attack_Entr.get())
        pokemonbaseStats['specialAttack'] = int(baseStats_Alola_specialAttack_Entr.get())
        pokemonbaseStats['specialDefense'] = int(baseStats_Alola_specialDefense_Entr.get())
        pokemonbaseStats['defense'] = int(baseStats_Alola_defense_Entr.get())
        pokemonbaseStats['speed'] = int(baseStats_Alola_speed_Entr.get())

        pokemonbasePoints = pokemonSelf_data['basePoints']
        pokemonbasePoints['hp'] = int(basePoints_Alola_hp_Entr.get())
        pokemonbasePoints['attack'] = int(basePoints_Alola_attack_Entr.get())
        pokemonbasePoints['specialAttack'] = int(basePoints_Alola_specialAttack_Entr.get())
        pokemonbasePoints['specialDefense'] = int(basePoints_Alola_specialDefense_Entr.get())
        pokemonbasePoints['defense'] = int(basePoints_Alola_defense_Entr.get())
        pokemonbasePoints['speed'] = int(basePoints_Alola_speed_Entr.get())

        pokemonSelf_data['baseStats'] = pokemonbaseStats
        pokemonSelf_data['basePoints'] = pokemonbasePoints
        # 种族值与基础点数更新
        pokemonSelf_data['catchRare'] = int(catchRareBox_Alola.get())
        # 捕获率更新
        pokemonSelf_data['heightm'] = float(heightmBox_Alola.get())
        pokemonSelf_data['weightkg'] = float(weightkgBox_Alola.get())
        # 身高体重更新
        if pokedex_text_Alola.get('0.0', 'end').strip('\n') == '<请输入内容>':
            pokemonSelf_data['pokedex'] = ''
        else:
            pokemonSelf_data['pokedex'] = pokedex_text_Alola.get('0.0', 'end').rstrip()

        if typeList1_Alola.get() == 'none':
            pokemonSelf_data['types'] = []
        else:
            if typeList2_Alola.get() == 'none':
                pokemonSelf_data['types'] = [typeChange(typeList1_Alola.get())]
            else:
                pokemonSelf_data['types'] = [typeChange(typeList1_Alola.get()), typeChange(typeList2_Alola.get())]
        # 属性更新
        if EggList1_Alola.get() == 'none':
            pokemonSelf_data['eggGroups'] = []
        else:
            if EggList2_Alola.get() == 'none':
                pokemonSelf_data['eggGroups'] = [EggChange(EggList1_Alola.get())]
            else:
                pokemonSelf_data['eggGroups'] = [EggChange(EggList1_Alola.get()), EggChange(EggList2_Alola.get())]
        # 蛋组更新
        if ColorList_Alola.get() == 'none':
            pokemonSelf_data['color'] = ''
        else:
            pokemonSelf_data['color'] = ColorChange(ColorList_Alola.get())
        # 颜色更新
        if genderTatioList_Alola.get() == 'none':
            pokemonSelf_data['genderTatio'] = ''
        else:
            print(genderTatioChange(genderTatioList_Alola.get()))
            genderTatioFind = list(genderTatioChange(genderTatioList_Alola.get()))
            pokemonSelf_data['genderTatio'] = [int(genderTatioFind[1]), int(genderTatioFind[3])]
        # 性别更新
        if bodilyFormList_Alola.get() == 'none':
            pokemonSelf_data['bodilyForm'] = ''
        else:
            pokemonSelf_data['bodilyForm'] = bodilyFormChange(bodilyFormList_Alola.get())
        # 体型更新
        if LevelUpRareList_Alola.get() == 'none':
            pokemonSelf_data['levelupRare'] = ''
        else:
            pokemonSelf_data['levelupRare'] = LevelUpRareChange(LevelUpRareList_Alola.get())
        # 升级速率更新
        if hatchRareList_Alola.get() == 'none':
            pokemonSelf_data['hatchRare'] = ''
        else:
            pokemonSelf_data['hatchRare'] = hatchRareList_Alola.get()
        # 孵化周期更新
        if startFriendshipList_Alola.get() == 'none':
            pokemonSelf_data['startFriendship'] = ''
        else:
            pokemonSelf_data['startFriendship'] = startFriendshipList_Alola.get()
        # 初始亲密度更新
        pokemonSelf_dataAbilities = pokemonSelf_data['abilities']
        if AbilitiesMenu1_Alola.get() == 'none':
            pokemonSelf_dataAbilities['0'] = 'none'
        else:
            pokemonSelf_dataAbilities['0'] = AbilitiesChange(AbilitiesMenu1_Alola.get())
        if AbilitiesMenu2_Alola.get() == 'none':
            pokemonSelf_dataAbilities['1'] = 'none'
        else:
            pokemonSelf_dataAbilities['1'] = AbilitiesChange(AbilitiesMenu2_Alola.get())
        if AbilitiesMenu3_Alola.get() == 'none':
            pokemonSelf_dataAbilities['H'] = 'none'
        else:
            pokemonSelf_dataAbilities['H'] = AbilitiesChange(AbilitiesMenu3_Alola.get())
        pokemonSelf_data['abilities'] = pokemonSelf_dataAbilities
        # 特性更新
        pokemonAreadata[diff_value_1.get()] = pokemonSelf_data
        pokemonSelfdata[area] = pokemonAreadata
        print(pokemonAreadata)
        pokemon_data[num] = pokemonSelfdata
        pokemon_dataList['pokemon_list'] = pokemon_data
        jsondata = json.dumps(pokemon_dataList, ensure_ascii=False, indent=4, separators=(',', ':'))
        f = open('./pokemon_data/' + now_gen + '/pokemon.json', 'w',encoding='utf-8')
        f.write(jsondata)
        f.close()
    else:
        if pokemFormNameString_Galar.get() == 'No_nickName':
            pokemonSelf_data['formesName'] = ''
        else:
            pokemonSelf_data['formesName'] = pokemFormNameString_Galar.get()
        if pokekindString_Galar.get() == '<请填入类型>':
            pokemonSelf_data['kind'] = ''
        else:
            pokemonSelf_data['kind'] = pokekindString_Galar.get()

        for item1 in diffTypeEN:
            if diffTypeStat[item1]==diff_Type_value.get():
                pokemonSelf_data['formsType']=item1
                temp=pokeDataRes[item1]
                tempData=list(temp.keys())
                i=0
                temp2=pokemonSelf_data['forms']
                temp2={}
                for item2 in tempData:
                    temp2[str(i)] = item2
                    i+=1
                pokemonSelf_data['forms']=temp2
                break

        pokemonbaseStats = pokemonSelf_data['baseStats']
        pokemonbaseStats['hp'] = int(baseStats_Galar_hp_Entr.get())
        pokemonbaseStats['attack'] = int(baseStats_Galar_attack_Entr.get())
        pokemonbaseStats['specialAttack'] = int(baseStats_Galar_specialAttack_Entr.get())
        pokemonbaseStats['specialDefense'] = int(baseStats_Galar_specialDefense_Entr.get())
        pokemonbaseStats['defense'] = int(baseStats_Galar_defense_Entr.get())
        pokemonbaseStats['speed'] = int(baseStats_Galar_speed_Entr.get())

        pokemonbasePoints = pokemonSelf_data['basePoints']
        pokemonbasePoints['hp'] = int(basePoints_Galar_hp_Entr.get())
        pokemonbasePoints['attack'] = int(basePoints_Galar_attack_Entr.get())
        pokemonbasePoints['specialAttack'] = int(basePoints_Galar_specialAttack_Entr.get())
        pokemonbasePoints['specialDefense'] = int(basePoints_Galar_specialDefense_Entr.get())
        pokemonbasePoints['defense'] = int(basePoints_Galar_defense_Entr.get())
        pokemonbasePoints['speed'] = int(basePoints_Galar_speed_Entr.get())

        pokemonSelf_data['baseStats'] = pokemonbaseStats
        pokemonSelf_data['basePoints'] = pokemonbasePoints
        # 种族值与基础点数更新
        pokemonSelf_data['catchRare'] = int(catchRareBox_Galar.get())
        # 捕获率更新
        pokemonSelf_data['heightm'] = float(heightmBox_Galar.get())
        pokemonSelf_data['weightkg'] = float(weightkgBox_Galar.get())
        # 身高体重更新
        if pokedex_text_Galar.get('0.0', 'end').strip('\n') == '<请输入内容>':
            pokemonSelf_data['pokedex'] = ''
        else:
            pokemonSelf_data['pokedex'] = pokedex_text_Galar.get('0.0', 'end').rstrip()

        if typeList1_Galar.get() == 'none':
            pokemonSelf_data['types'] = []
        else:
            if typeList2_Galar.get() == 'none':
                pokemonSelf_data['types'] = [typeChange(typeList1_Galar.get())]
            else:
                pokemonSelf_data['types'] = [typeChange(typeList1_Galar.get()), typeChange(typeList2_Galar.get())]
        # 属性更新
        if EggList1_Galar.get() == 'none':
            pokemonSelf_data['eggGroups'] = []
        else:
            if EggList2_Galar.get() == 'none':
                pokemonSelf_data['eggGroups'] = [EggChange(EggList1_Galar.get())]
            else:
                pokemonSelf_data['eggGroups'] = [EggChange(EggList1_Galar.get()), EggChange(EggList2_Galar.get())]
        # 蛋组更新
        if ColorList_Galar.get() == 'none':
            pokemonSelf_data['color'] = ''
        else:
            pokemonSelf_data['color'] = ColorChange(ColorList_Galar.get())
        # 颜色更新
        if genderTatioList_Galar.get() == 'none':
            pokemonSelf_data['genderTatio'] = ''
        else:
            print(genderTatioChange(genderTatioList_Galar.get()))
            genderTatioFind = list(genderTatioChange(genderTatioList_Galar.get()))
            pokemonSelf_data['genderTatio'] = [int(genderTatioFind[1]), int(genderTatioFind[3])]
        # 性别更新
        if bodilyFormList_Galar.get() == 'none':
            pokemonSelf_data['bodilyForm'] = ''
        else:
            pokemonSelf_data['bodilyForm'] = bodilyFormChange(bodilyFormList_Galar.get())
        # 体型更新
        if LevelUpRareList_Galar.get() == 'none':
            pokemonSelf_data['levelupRare'] = ''
        else:
            pokemonSelf_data['levelupRare'] = LevelUpRareChange(LevelUpRareList_Galar.get())
        # 升级速率更新
        if hatchRareList_Galar.get() == 'none':
            pokemonSelf_data['hatchRare'] = ''
        else:
            pokemonSelf_data['hatchRare'] = hatchRareList_Galar.get()
        # 孵化周期更新
        if startFriendshipList_Galar.get() == 'none':
            pokemonSelf_data['startFriendship'] = ''
        else:
            pokemonSelf_data['startFriendship'] = startFriendshipList_Galar.get()
        # 初始亲密度更新
        pokemonSelf_dataAbilities = pokemonSelf_data['abilities']
        if AbilitiesMenu1_Galar.get() == 'none':
            pokemonSelf_dataAbilities['0'] = 'none'
        else:
            pokemonSelf_dataAbilities['0'] = AbilitiesChange(AbilitiesMenu1_Galar.get())
            print('ceshi')
            print(AbilitiesMenu1_Galar.get())
        if AbilitiesMenu2_Galar.get() == 'none':
            pokemonSelf_dataAbilities['1'] = 'none'
        else:
            pokemonSelf_dataAbilities['1'] = AbilitiesChange(AbilitiesMenu2_Galar.get())
        if AbilitiesMenu3_Galar.get() == 'none':
            pokemonSelf_dataAbilities['H'] = 'none'
        else:
            pokemonSelf_dataAbilities['H'] = AbilitiesChange(AbilitiesMenu3_Galar.get())
        pokemonSelf_data['abilities'] = pokemonSelf_dataAbilities
        # 特性更新
        pokemonAreadata[diff_value_1.get()] = pokemonSelf_data
        pokemonSelfdata[area] = pokemonAreadata
        print(pokemonAreadata)
        pokemon_data[num] = pokemonSelfdata
        pokemon_dataList['pokemon_list'] = pokemon_data
        jsondata = json.dumps(pokemon_dataList,ensure_ascii=False, indent=4, separators=(',', ':'))
        f = open('./pokemon_data/' + now_gen + '/pokemon.json', 'w',encoding='utf-8')
        f.write(jsondata)
        f.close()


top = tkinter.Tk()
top.geometry()
top.title('宝可梦编辑器')
#top.iconbitmap('./res/edit.ico')
pokeRes=json.load(open('./res/resData.json',encoding='utf-8'))#资源集合
pokemon_dataList=[]
pokemon_Item=[]
area='Normal'
NO_diff=0
Form_diff=0
Forms={}
start_frame=tkinter.Frame(top,width=300)
start_frame.pack()
pokedex_frame=tkinter.Frame(top,height=810,width=600)
pokedex_frame.pack_propagate(0)
pokedex_top=tkinter.Frame(pokedex_frame)
pokedex_bottom=tkinter.Frame(pokedex_frame)
pokeNUMNAM_frame=tkinter.Frame(pokedex_top)
pokeNUM_frame=tkinter.Frame(pokeNUMNAM_frame)
pokeNAMC_frame=tkinter.Frame(pokeNUMNAM_frame)
pokeNAME_frame=tkinter.Frame(pokeNUMNAM_frame)

pokePIC_frame=tkinter.Frame(pokedex_top)
pokePIC_label=tkinter.Label(pokePIC_frame,text='拖拽更新图片素材')
diff_value=tkinter.StringVar()
diff_Type_value=tkinter.StringVar()
pokeDataRes=pokeRes['res']
diffTypeStat=pokeDataRes['formsDiff']
diffTypeCnStat=list(diffTypeStat.values())
diff_Type_var=['',*diffTypeCnStat]
diff_Type_value.set(diff_Type_var[1])
diff_var=['','选择形态']
diff_value.set(diff_var[1])
pokePIC_diff_frame=tkinter.Frame(pokePIC_frame)
pokePICdiffTypeFrame=tkinter.Frame(pokePIC_diff_frame)
pokePICdiffFrame=tkinter.Frame(pokePIC_diff_frame)
pokePIC_diff_Type_label=tkinter.Label(pokePICdiffTypeFrame,text='样子差异类型：')
pokePIC_diff_Type=tkinter.ttk.OptionMenu(pokePICdiffTypeFrame,diff_Type_value,*diff_Type_var,command=changeFormTypeDiff)
pokePIC_diff_label=tkinter.Label(pokePICdiffFrame,text='差异细分：')
pokePIC_diff=tkinter.ttk.OptionMenu(pokePICdiffFrame,diff_value,*diff_var,command=checkFormDiff)
'''
大修改
'''
pokePIC_Ico=tkinter.Label(pokePIC_frame)
windnd.hook_dropfiles(pokePIC_Ico,func=lambda filePath:check_pic('icon',filePath))
pokePIC_battle=tkinter.Frame(pokePIC_frame)
pokePIC_Normal=tkinter.Frame(pokePIC_battle)
pokePIC_shine=tkinter.Frame(pokePIC_battle)

pokePIC_Front=tkinter.Label(pokePIC_Normal)
windnd.hook_dropfiles(pokePIC_Front,func=lambda filePath:check_pic('front',filePath))
pokePIC_Back=tkinter.Label(pokePIC_Normal)
windnd.hook_dropfiles(pokePIC_Back,func=lambda filePath:check_pic('back',filePath))
pokePIC_Normal_label=tkinter.Label(pokePIC_battle,text='寻常样子')
pokePIC_Front_S=tkinter.Label(pokePIC_shine)
windnd.hook_dropfiles(pokePIC_Front_S,func=lambda filePath:check_pic('fronts',filePath))
pokePIC_Back_S=tkinter.Label(pokePIC_shine)
windnd.hook_dropfiles(pokePIC_Back_S,func=lambda filePath:check_pic('backs',filePath))
pokePIC_Shine_label=tkinter.Label(pokePIC_battle,text='闪光样子')

pokemon_NUM=tkinter.Label(pokeNUM_frame,text='编号')
nameEN_label=tkinter.Label(pokeNAME_frame,text='英文名：')
nameCN_label=tkinter.Label(pokeNAMC_frame,text='中文名：')
pokemon_nameEN=tkinter.StringVar()
nameEN_Entr=tkinter.Entry(pokeNAME_frame)
pokemon_nameCN=tkinter.StringVar()
nameCN_Entr=tkinter.Entry(pokeNAMC_frame)

Data_Notebook=tkinter.ttk.Notebook(pokedex_bottom)
text=Data_Notebook.select()
baseStats={ 'hp':0,
            'attack':0,
            'defense':0,
            'specialAttack':0,
            'specialDefense':0,
            'speed':0
           }
evolution={'target':'',
           'pattem':'',
           'condition':''
           }
abilities={'0':'none',
           '1':'none',
           'H':'none'
}
pokemon={'formesName':'',
         'formsType':'noFormDiff',
         'forms': {'0':'none'},
         'types': [],
         'genderTatio':'',
         'levelupRare':'',
         'kind':'',
         'pokedex':'',
         'baseStats':baseStats,
         'basePoints':baseStats,
         'evolution':'',
         'abilities':abilities,
         'heightm':'',
         'weightkg':'',
         'color':'',
         'bodilyForm':'',
         'eggGroups':[],
         'catchRare':'',
         'startFriendship':'',
         'hatchRare':''
         }
startFriendship=[0,35,50,70,90,100,140]
hatchRare=[5,10,15,20,25,30,35,40,80,120]
im_icon=Image.open('./res/0_icon.png')
im_front=Image.open('./res/0_front.png')
im_back=Image.open('./res/0_back.png')
im_fronts=Image.open('res/0_fronts.png')
im_backs=Image.open('res/0_backs.png')
Ico_open = ImageTk.PhotoImage(image=im_icon)
Front_open = ImageTk.PhotoImage(image=im_front)
Back_open = ImageTk.PhotoImage(image=im_back)
FrontS_open = ImageTk.PhotoImage(image=im_fronts)
BackS_open = ImageTk.PhotoImage(image=im_backs)

frame_Normal=tkinter.Frame(pokedex_frame)

diff_value_1=tkinter.StringVar()
diff_values_1=['',0]
diff_value_1.set(diff_values_1[1])

diff_value_2=tkinter.StringVar()
diff_values_2=['',0]
diff_value_2.set(diff_values_2[1])

diff_value_3=tkinter.StringVar()
diff_values_3=['',0]
diff_value_3.set(diff_values_3[1])

Normal_diffFrame=tkinter.Frame(frame_Normal)

Normal_diff_label=tkinter.Label(Normal_diffFrame,text='形态编号:')
Normal_diff=tkinter.ttk.OptionMenu(Normal_diffFrame,diff_value_1,*diff_values_1,command=check_diff)
Normal_diff_Button=tkinter.Button(Normal_diffFrame,text='+')

frame_Alola=tkinter.Frame(pokedex_frame)

Alola_diffFrame=tkinter.Frame(frame_Alola)
Alola_diff_label=tkinter.Label(Alola_diffFrame,text='形态编号:')
Alola_diff=tkinter.ttk.OptionMenu(Alola_diffFrame,diff_value_2,*diff_values_2,command=check_diff)
Alola_diff_Button=tkinter.Button(Alola_diffFrame,text='+')

frame_Galar=tkinter.Frame(pokedex_frame)

Galar_diffFrame=tkinter.Frame(frame_Galar)
Galar_diff_label=tkinter.Label(Galar_diffFrame,text='形态编号:')
Galar_diff=tkinter.ttk.OptionMenu(Galar_diffFrame,diff_value_3,*diff_values_3,command=check_diff)
Galar_diff_Button=tkinter.Button(Galar_diffFrame,text='+')

types=res_update.get_res('types')
Abilities=res_update.get_res('abilities')
Eggs=res_update.get_res('eggGroups')
Colors=res_update.get_res('color')
bodilyForms=res_update.get_res('bodilyForm')
genderTatios=res_update.get_res('genderTatio')
LevelUpRares=res_update.get_res('LevelUpRare')
#基本数据获取

Data_Normal=tkinter.Frame(frame_Normal)
Sep_Normal=tkinter.ttk.Separator(frame_Normal,orient='horizontal')
frame_Normal_part_1=tkinter.Frame(Data_Normal)
frame_Normal_part_2=tkinter.Frame(Data_Normal)

pokeFormName_Normal=tkinter.Frame(frame_Normal_part_1)
pokemFormNameString_Normal=tkinter.StringVar()
pokeFormName_label_Normal=tkinter.Label(pokeFormName_Normal,text='形态别名:')
pokeFormName_littleFrame_Normal=tkinter.Frame(pokeFormName_Normal)
pokeFormName_Entr_Normal=tkinter.Entry(pokeFormName_littleFrame_Normal,width =15)

pokekind_Normal=tkinter.Frame(frame_Normal_part_1)
pokekind_label_Normal=tkinter.Label(pokekind_Normal,text='类别:')
pokekind_littleFrame_Normal=tkinter.Frame(pokekind_Normal)
pokekindString_Normal=tkinter.StringVar()
pokekind_Entr_Normal=tkinter.Entry(pokekind_littleFrame_Normal,width =12)
pokekind_label2_Normal=tkinter.Label(pokekind_littleFrame_Normal,text='宝可梦')

Type_Normal=tkinter.Frame(frame_Normal_part_1)
typeList1_Normal=tkinter.StringVar()
typeList2_Normal=tkinter.StringVar()
typeLists=['','none',*list(types.values())]
typeList1_Normal.set(typeLists[1])
typeList2_Normal.set(typeLists[1])
print(typeLists)
Type1_Normal_label=tkinter.Label(Type_Normal,text='属性1：')
Type1_Normal=tkinter.ttk.OptionMenu(Type_Normal,typeList1_Normal,*typeLists,direction='right')
Type2_Normal_label=tkinter.Label(Type_Normal,text='属性2：')
Type2_Normal=tkinter.ttk.OptionMenu(Type_Normal,typeList2_Normal,*typeLists,direction='right')

Abilities_Normal=tkinter.LabelFrame(frame_Normal_part_1,labelanchor='nw',text='特性')
Abilities_1_Normal=tkinter.Frame(Abilities_Normal)
Abilities_2_Normal=tkinter.Frame(Abilities_Normal)
Abilities_3_Normal=tkinter.Frame(Abilities_Normal)
AbilitiesList1_Normal=tkinter.StringVar()
AbilitiesList2_Normal=tkinter.StringVar()
AbilitiesList3_Normal=tkinter.StringVar()
AbilitiesLists=['none',*list(Abilities.values())]
AbilitiesList1_Normal.set(AbilitiesLists[0])
AbilitiesList2_Normal.set(AbilitiesLists[0])
AbilitiesList3_Normal.set(AbilitiesLists[0])
Abilities1_Normal_label=tkinter.Label(Abilities_1_Normal,text='特性1：',width =10)
AbilitiesMenu1_Normal=AutocompleteCombobox(Abilities_1_Normal,height=5,values=AbilitiesLists)
AbilitiesMenu1_Normal.set_completion_list(AbilitiesLists)
#AbilitiesMenu1_Normal.configure(state="readonly")
Abilities2_Normal_label=tkinter.Label(Abilities_2_Normal,text='特性2：',width =10)
AbilitiesMenu2_Normal=AutocompleteCombobox(Abilities_2_Normal,height=5,values=AbilitiesLists)
AbilitiesMenu2_Normal.set_completion_list(AbilitiesLists)
#AbilitiesMenu2_Normal.configure(state="readonly")
Abilities3_Normal_label=tkinter.Label(Abilities_3_Normal,text='隐藏特性：',width =10)
AbilitiesMenu3_Normal=AutocompleteCombobox(Abilities_3_Normal,height=5,values=AbilitiesLists)
AbilitiesMenu3_Normal.set_completion_list(AbilitiesLists)
#AbilitiesMenu3_Normal.configure(state="readonly")

Egg_Normal=tkinter.LabelFrame(frame_Normal_part_2,labelanchor='nw',text='蛋群')
Egg1_Frame_Normal=tkinter.Frame(Egg_Normal)
Egg2_Frame_Normal=tkinter.Frame(Egg_Normal)
EggList1_Normal=tkinter.StringVar()
EggList2_Normal=tkinter.StringVar()
EggLists=['','none',*list(Eggs.values())]
EggList1_Normal.set(EggLists[1])
EggList2_Normal.set(EggLists[1])
Egg1_Normal_label=tkinter.Label(Egg1_Frame_Normal,text='蛋组1：',width =5)
Egg1_Normal=tkinter.ttk.OptionMenu(Egg1_Frame_Normal,EggList1_Normal,*EggLists)
Egg2_Normal_label=tkinter.Label(Egg2_Frame_Normal,text='蛋组2：',width =5)
Egg2_Normal=tkinter.ttk.OptionMenu(Egg2_Frame_Normal,EggList2_Normal,*EggLists)

Color_Normal=tkinter.Frame(frame_Normal_part_2)
ColorList_Normal=tkinter.StringVar()
ColorLists=['','none',*list(Colors.values())]
ColorList_Normal.set(ColorLists[1])
Color_Normal_label=tkinter.Label(Color_Normal,text='颜色：',width =5)
ColorMenu_Normal=tkinter.ttk.OptionMenu(Color_Normal,ColorList_Normal,*ColorLists)

genderTatio_Normal=tkinter.Frame(frame_Normal_part_1)
genderTatioList_Normal=tkinter.StringVar()
genderTatioLists=['','none',*list(genderTatios.values())]
genderTatioList_Normal.set(genderTatioLists[1])
genderTatio_Normal_label=tkinter.Label(genderTatio_Normal,text='性别比♂:♀：')
genderTatioMenu_Normal=tkinter.ttk.OptionMenu(genderTatio_Normal,genderTatioList_Normal,*genderTatioLists)


bodilyForm_Normal=tkinter.Frame(frame_Normal_part_2)
bodilyFormList_Normal=tkinter.StringVar()
bodilyFormLists=['','none',*list(bodilyForms.values())]
bodilyFormList_Normal.set(bodilyFormLists[1])
bodilyForm_Normal_label=tkinter.Label(bodilyForm_Normal,text='体型：',width =5)
bodilyFormMenu_Normal=tkinter.ttk.OptionMenu(bodilyForm_Normal,bodilyFormList_Normal,*bodilyFormLists)

hatchRare_Normal=tkinter.Frame(frame_Normal_part_2)
hatchRareList_Normal=tkinter.StringVar()
hatchRareLists=['','none',*hatchRare]
hatchRareList_Normal.set(hatchRareLists[1])
hatchRare_Normal_label=tkinter.Label(hatchRare_Normal,text='孵化周期：',width =10)
hatchRareMenu_Normal=tkinter.ttk.OptionMenu(hatchRare_Normal,hatchRareList_Normal,*hatchRareLists)

pokedex_Normal=tkinter.Frame(frame_Normal_part_2)
pokedex_label_Normal=tkinter.Label(pokedex_Normal,text='图鉴说明:',width =10)
pokedex_text_Normal=tkinter.Text(pokedex_Normal,width =30,height=10)

startFriendship_Normal=tkinter.Frame(frame_Normal_part_2)
startFriendshipList_Normal=tkinter.StringVar()
startFriendshipLists=['','none',*startFriendship]
startFriendshipList_Normal.set(startFriendshipLists[1])
startFriendship_Normal_label=tkinter.Label(startFriendship_Normal,text='初始亲密度：')
startFriendshipMenu_Normal=tkinter.ttk.OptionMenu(startFriendship_Normal,startFriendshipList_Normal,*startFriendshipLists)

catchRare_Normal=tkinter.Frame(frame_Normal_part_1)
catchRare_Normal_str=tkinter.StringVar()
catchRare_Normal_label=tkinter.Label(catchRare_Normal,text='捕获率：')
catchRareBox_Normal=tkinter.Spinbox(catchRare_Normal,from_=3,to=255,width =5,textvariable=catchRare_Normal_str)

heightm_Normal=tkinter.Frame(frame_Normal_part_2)
heightm_Normal_str=tkinter.StringVar()
heightm_Normal_label=tkinter.Label(heightm_Normal,text='身高：')
heightmBox_Normal=tkinter.Spinbox(heightm_Normal,from_=0,to=10000,increment=0.1,width =5,textvariable=heightm_Normal_str)
heightm_Normal_labelM=tkinter.Label(heightm_Normal,text='m')

weightkg_Normal=tkinter.Frame(frame_Normal_part_2)
weightkg_Normal_str=tkinter.StringVar()
weightkg_Normal_label=tkinter.Label(weightkg_Normal,text='体重：')
weightkgBox_Normal=tkinter.Spinbox(weightkg_Normal,from_=0,to=10000,increment=0.1,width =5,textvariable=weightkg_Normal_str)
weightkg_Normal_labelKG=tkinter.Label(weightkg_Normal,text='kg')


LevelUpRare_Normal=tkinter.Frame(frame_Normal_part_1)
LevelUpRareList_Normal=tkinter.StringVar()
LevelUpRareLists=['','none',*list(LevelUpRares.values())]
LevelUpRareList_Normal.set(LevelUpRareLists[1])
LevelUpRare_Normal_label=tkinter.Label(LevelUpRare_Normal,text='升级速率：')
LevelUpRareMenu_Normal=tkinter.ttk.OptionMenu(LevelUpRare_Normal,LevelUpRareList_Normal,*LevelUpRareLists)

BallteData_Normal=tkinter.Frame(frame_Normal_part_1)
baseStatsLabel_Normal=tkinter.LabelFrame(BallteData_Normal, text="种族值", labelanchor="nw")
basePointsLabel_Normal=tkinter.LabelFrame(BallteData_Normal, text="基础点数", labelanchor="nw")

baseStats_hp_Normal=tkinter.Frame(baseStatsLabel_Normal)
baseStats_Normal_hp_label=tkinter.Label(baseStats_hp_Normal,text='HP：',width =5)
baseStats_Normal_hp=tkinter.StringVar()
baseStats_Normal_hp_Entr=tkinter.Entry(baseStats_hp_Normal,width =5)
baseStats_attack_Normal=tkinter.Frame(baseStatsLabel_Normal)
baseStats_Normal_attack_label=tkinter.Label(baseStats_attack_Normal,text='攻击：',width =5)
baseStats_Normal_attack=tkinter.StringVar()
baseStats_Normal_attack_Entr=tkinter.Entry(baseStats_attack_Normal,width =5)
baseStats_defense_Normal=tkinter.Frame(baseStatsLabel_Normal)
baseStats_Normal_defense_label=tkinter.Label(baseStats_defense_Normal,text='防御：',width =5)
baseStats_Normal_defense=tkinter.StringVar()
baseStats_Normal_defense_Entr=tkinter.Entry(baseStats_defense_Normal,width =5)
baseStats_specialAttack_Normal=tkinter.Frame(baseStatsLabel_Normal)
baseStats_Normal_specialAttack_label=tkinter.Label(baseStats_specialAttack_Normal,text='特攻：',width =5)
baseStats_Normal_specialAttack=tkinter.StringVar()
baseStats_Normal_specialAttack_Entr=tkinter.Entry(baseStats_specialAttack_Normal,width =5)
baseStats_specialDefense_Normal=tkinter.Frame(baseStatsLabel_Normal)
baseStats_Normal_specialDefense_label=tkinter.Label(baseStats_specialDefense_Normal,text='特防：',width =5)
baseStats_Normal_specialDefense=tkinter.StringVar()
baseStats_Normal_specialDefense_Entr=tkinter.Entry(baseStats_specialDefense_Normal,width =5)
baseStats_speed_Normal=tkinter.Frame(baseStatsLabel_Normal)
baseStats_Normal_speed_label=tkinter.Label(baseStats_speed_Normal,text='速度：')
baseStats_Normal_speed=tkinter.StringVar()
baseStats_Normal_speed_Entr=tkinter.Entry(baseStats_speed_Normal,width =5)

basePoints_hp_Normal=tkinter.Frame(basePointsLabel_Normal)
basePoints_Normal_hp_label=tkinter.Label(basePoints_hp_Normal,text='HP：',width =5)
basePoints_Normal_hp=tkinter.StringVar()
basePoints_Normal_hp_Entr=tkinter.Entry(basePoints_hp_Normal,width =5)
basePoints_attack_Normal=tkinter.Frame(basePointsLabel_Normal)
basePoints_Normal_attack_label=tkinter.Label(basePoints_attack_Normal,text='攻击：',width =5)
basePoints_Normal_attack=tkinter.StringVar()
basePoints_Normal_attack_Entr=tkinter.Entry(basePoints_attack_Normal,width =5)
basePoints_defense_Normal=tkinter.Frame(basePointsLabel_Normal)
basePoints_Normal_defense_label=tkinter.Label(basePoints_defense_Normal,text='防御：',width =5)
basePoints_Normal_defense=tkinter.StringVar()
basePoints_Normal_defense_Entr=tkinter.Entry(basePoints_defense_Normal,width =5)
basePoints_specialAttack_Normal=tkinter.Frame(basePointsLabel_Normal)
basePoints_Normal_specialAttack_label=tkinter.Label(basePoints_specialAttack_Normal,text='特攻：',width =5)
basePoints_Normal_specialAttack=tkinter.StringVar()
basePoints_Normal_specialAttack_Entr=tkinter.Entry(basePoints_specialAttack_Normal,width =5)
basePoints_specialDefense_Normal=tkinter.Frame(basePointsLabel_Normal)
basePoints_Normal_specialDefense_label=tkinter.Label(basePoints_specialDefense_Normal,text='特防：',width =5)
basePoints_Normal_specialDefense=tkinter.StringVar()
basePoints_Normal_specialDefense_Entr=tkinter.Entry(basePoints_specialDefense_Normal,width =5)
basePoints_speed_Normal=tkinter.Frame(basePointsLabel_Normal)
basePoints_Normal_speed_label=tkinter.Label(basePoints_speed_Normal,text='速度：')
basePoints_Normal_speed=tkinter.StringVar()
basePoints_Normal_speed_Entr=tkinter.Entry(basePoints_speed_Normal,width =5)
#一般形态tab的组件集合
Data_Alola=tkinter.Frame(frame_Alola)
Sep_Alola=tkinter.ttk.Separator(frame_Alola,orient='horizontal')
frame_Alola_part_1=tkinter.Frame(Data_Alola)
frame_Alola_part_2=tkinter.Frame(Data_Alola)

pokeFormName_Alola=tkinter.Frame(frame_Alola_part_1)
pokemFormNameString_Alola=tkinter.StringVar()
pokeFormName_label_Alola=tkinter.Label(pokeFormName_Alola,text='形态别名:')
pokeFormName_littleFrame_Alola=tkinter.Frame(pokeFormName_Alola)
pokeFormName_Entr_Alola=tkinter.Entry(pokeFormName_littleFrame_Alola,width =15)

pokekind_Alola=tkinter.Frame(frame_Alola_part_1)
pokekind_label_Alola=tkinter.Label(pokekind_Alola,text='类别:')
pokekind_littleFrame_Alola=tkinter.Frame(pokekind_Alola)
pokekindString_Alola=tkinter.StringVar()
pokekind_Entr_Alola=tkinter.Entry(pokekind_littleFrame_Alola,width =12)
pokekind_label2_Alola=tkinter.Label(pokekind_littleFrame_Alola,text='宝可梦')

Type_Alola=tkinter.Frame(frame_Alola_part_1)
typeList1_Alola=tkinter.StringVar()
typeList2_Alola=tkinter.StringVar()
typeLists=['','none',*list(types.values())]
typeList1_Alola.set(typeLists[1])
typeList2_Alola.set(typeLists[1])
print(typeLists)
Type1_Alola_label=tkinter.Label(Type_Alola,text='属性1：')
Type1_Alola=tkinter.ttk.OptionMenu(Type_Alola,typeList1_Alola,*typeLists,direction='right')
Type2_Alola_label=tkinter.Label(Type_Alola,text='属性2：')
Type2_Alola=tkinter.ttk.OptionMenu(Type_Alola,typeList2_Alola,*typeLists,direction='right')

Abilities_Alola=tkinter.LabelFrame(frame_Alola_part_1,labelanchor='nw',text='特性')
Abilities_1_Alola=tkinter.Frame(Abilities_Alola)
Abilities_2_Alola=tkinter.Frame(Abilities_Alola)
Abilities_3_Alola=tkinter.Frame(Abilities_Alola)
AbilitiesList1_Alola=tkinter.StringVar()
AbilitiesList2_Alola=tkinter.StringVar()
AbilitiesList3_Alola=tkinter.StringVar()
AbilitiesLists=['none',*list(Abilities.values())]
AbilitiesList1_Alola.set(AbilitiesLists[0])
AbilitiesList2_Alola.set(AbilitiesLists[0])
AbilitiesList3_Alola.set(AbilitiesLists[0])
Abilities1_Alola_label=tkinter.Label(Abilities_1_Alola,text='特性1：',width =10)
AbilitiesMenu1_Alola=AutocompleteCombobox(Abilities_1_Alola,height=5,values=AbilitiesLists)
AbilitiesMenu1_Alola.set_completion_list(AbilitiesLists)
#AbilitiesMenu1_Alola.configure(state="readonly")
Abilities2_Alola_label=tkinter.Label(Abilities_2_Alola,text='特性2：',width =10)
AbilitiesMenu2_Alola=AutocompleteCombobox(Abilities_2_Alola,height=5,values=AbilitiesLists)
AbilitiesMenu2_Alola.set_completion_list(AbilitiesLists)
#AbilitiesMenu2_Alola.configure(state="readonly")
Abilities3_Alola_label=tkinter.Label(Abilities_3_Alola,text='隐藏特性：',width =10)
AbilitiesMenu3_Alola=AutocompleteCombobox(Abilities_3_Alola,height=5,values=AbilitiesLists)
AbilitiesMenu3_Alola.set_completion_list(AbilitiesLists)
#AbilitiesMenu3_Alola.configure(state="readonly")

Egg_Alola=tkinter.LabelFrame(frame_Alola_part_2,labelanchor='nw',text='蛋群')
Egg1_Frame_Alola=tkinter.Frame(Egg_Alola)
Egg2_Frame_Alola=tkinter.Frame(Egg_Alola)
EggList1_Alola=tkinter.StringVar()
EggList2_Alola=tkinter.StringVar()
EggLists=['','none',*list(Eggs.values())]
EggList1_Alola.set(EggLists[1])
EggList2_Alola.set(EggLists[1])
Egg1_Alola_label=tkinter.Label(Egg1_Frame_Alola,text='蛋组1：',width =5)
Egg1_Alola=tkinter.ttk.OptionMenu(Egg1_Frame_Alola,EggList1_Alola,*EggLists)
Egg2_Alola_label=tkinter.Label(Egg2_Frame_Alola,text='蛋组2：',width =5)
Egg2_Alola=tkinter.ttk.OptionMenu(Egg2_Frame_Alola,EggList2_Alola,*EggLists)

Color_Alola=tkinter.Frame(frame_Alola_part_2)
ColorList_Alola=tkinter.StringVar()
ColorLists=['','none',*list(Colors.values())]
ColorList_Alola.set(ColorLists[1])
Color_Alola_label=tkinter.Label(Color_Alola,text='颜色：',width =5)
ColorMenu_Alola=tkinter.ttk.OptionMenu(Color_Alola,ColorList_Alola,*ColorLists)

genderTatio_Alola=tkinter.Frame(frame_Alola_part_1)
genderTatioList_Alola=tkinter.StringVar()
genderTatioLists=['','none',*list(genderTatios.values())]
genderTatioList_Alola.set(genderTatioLists[1])
genderTatio_Alola_label=tkinter.Label(genderTatio_Alola,text='性别比♂:♀：')
genderTatioMenu_Alola=tkinter.ttk.OptionMenu(genderTatio_Alola,genderTatioList_Alola,*genderTatioLists)


bodilyForm_Alola=tkinter.Frame(frame_Alola_part_2)
bodilyFormList_Alola=tkinter.StringVar()
bodilyFormLists=['','none',*list(bodilyForms.values())]
bodilyFormList_Alola.set(bodilyFormLists[1])
bodilyForm_Alola_label=tkinter.Label(bodilyForm_Alola,text='体型：',width =5)
bodilyFormMenu_Alola=tkinter.ttk.OptionMenu(bodilyForm_Alola,bodilyFormList_Alola,*bodilyFormLists)

hatchRare_Alola=tkinter.Frame(frame_Alola_part_2)
hatchRareList_Alola=tkinter.StringVar()
hatchRareLists=['','none',*hatchRare]
hatchRareList_Alola.set(hatchRareLists[1])
hatchRare_Alola_label=tkinter.Label(hatchRare_Alola,text='孵化周期：',width =10)
hatchRareMenu_Alola=tkinter.ttk.OptionMenu(hatchRare_Alola,hatchRareList_Alola,*hatchRareLists)

pokedex_Alola=tkinter.Frame(frame_Alola_part_2)
pokedex_label_Alola=tkinter.Label(pokedex_Alola,text='图鉴说明:',width =10)
pokedex_text_Alola=tkinter.Text(pokedex_Alola,width =30,height=10)

startFriendship_Alola=tkinter.Frame(frame_Alola_part_2)
startFriendshipList_Alola=tkinter.StringVar()
startFriendshipLists=['','none',*startFriendship]
startFriendshipList_Alola.set(startFriendshipLists[1])
startFriendship_Alola_label=tkinter.Label(startFriendship_Alola,text='初始亲密度：')
startFriendshipMenu_Alola=tkinter.ttk.OptionMenu(startFriendship_Alola,startFriendshipList_Alola,*startFriendshipLists)

catchRare_Alola=tkinter.Frame(frame_Alola_part_1)
catchRare_Alola_str=tkinter.StringVar()
catchRare_Alola_label=tkinter.Label(catchRare_Alola,text='捕获率：')
catchRareBox_Alola=tkinter.Spinbox(catchRare_Alola,from_=3,to=255,width =5,textvariable=catchRare_Alola_str)

heightm_Alola=tkinter.Frame(frame_Alola_part_2)
heightm_Alola_str=tkinter.StringVar()
heightm_Alola_label=tkinter.Label(heightm_Alola,text='身高：')
heightmBox_Alola=tkinter.Spinbox(heightm_Alola,from_=0,to=10000,increment=0.1,width =5,textvariable=heightm_Alola_str)
heightm_Alola_labelM=tkinter.Label(heightm_Alola,text='m')

weightkg_Alola=tkinter.Frame(frame_Alola_part_2)
weightkg_Alola_str=tkinter.StringVar()
weightkg_Alola_label=tkinter.Label(weightkg_Alola,text='体重：')
weightkgBox_Alola=tkinter.Spinbox(weightkg_Alola,from_=0,to=10000,increment=0.1,width =5,textvariable=weightkg_Alola_str)
weightkg_Alola_labelKG=tkinter.Label(weightkg_Alola,text='kg')


LevelUpRare_Alola=tkinter.Frame(frame_Alola_part_1)
LevelUpRareList_Alola=tkinter.StringVar()
LevelUpRareLists=['','none',*list(LevelUpRares.values())]
LevelUpRareList_Alola.set(LevelUpRareLists[1])
LevelUpRare_Alola_label=tkinter.Label(LevelUpRare_Alola,text='升级速率：')
LevelUpRareMenu_Alola=tkinter.ttk.OptionMenu(LevelUpRare_Alola,LevelUpRareList_Alola,*LevelUpRareLists)

BallteData_Alola=tkinter.Frame(frame_Alola_part_1)
baseStatsLabel_Alola=tkinter.LabelFrame(BallteData_Alola, text="种族值", labelanchor="nw")
basePointsLabel_Alola=tkinter.LabelFrame(BallteData_Alola, text="基础点数", labelanchor="nw")

baseStats_hp_Alola=tkinter.Frame(baseStatsLabel_Alola)
baseStats_Alola_hp_label=tkinter.Label(baseStats_hp_Alola,text='HP：',width =5)
baseStats_Alola_hp=tkinter.StringVar()
baseStats_Alola_hp_Entr=tkinter.Entry(baseStats_hp_Alola,width =5)
baseStats_attack_Alola=tkinter.Frame(baseStatsLabel_Alola)
baseStats_Alola_attack_label=tkinter.Label(baseStats_attack_Alola,text='攻击：',width =5)
baseStats_Alola_attack=tkinter.StringVar()
baseStats_Alola_attack_Entr=tkinter.Entry(baseStats_attack_Alola,width =5)
baseStats_defense_Alola=tkinter.Frame(baseStatsLabel_Alola)
baseStats_Alola_defense_label=tkinter.Label(baseStats_defense_Alola,text='防御：',width =5)
baseStats_Alola_defense=tkinter.StringVar()
baseStats_Alola_defense_Entr=tkinter.Entry(baseStats_defense_Alola,width =5)
baseStats_specialAttack_Alola=tkinter.Frame(baseStatsLabel_Alola)
baseStats_Alola_specialAttack_label=tkinter.Label(baseStats_specialAttack_Alola,text='特攻：',width =5)
baseStats_Alola_specialAttack=tkinter.StringVar()
baseStats_Alola_specialAttack_Entr=tkinter.Entry(baseStats_specialAttack_Alola,width =5)
baseStats_specialDefense_Alola=tkinter.Frame(baseStatsLabel_Alola)
baseStats_Alola_specialDefense_label=tkinter.Label(baseStats_specialDefense_Alola,text='特防：',width =5)
baseStats_Alola_specialDefense=tkinter.StringVar()
baseStats_Alola_specialDefense_Entr=tkinter.Entry(baseStats_specialDefense_Alola,width =5)
baseStats_speed_Alola=tkinter.Frame(baseStatsLabel_Alola)
baseStats_Alola_speed_label=tkinter.Label(baseStats_speed_Alola,text='速度：')
baseStats_Alola_speed=tkinter.StringVar()
baseStats_Alola_speed_Entr=tkinter.Entry(baseStats_speed_Alola,width =5)

basePoints_hp_Alola=tkinter.Frame(basePointsLabel_Alola)
basePoints_Alola_hp_label=tkinter.Label(basePoints_hp_Alola,text='HP：',width =5)
basePoints_Alola_hp=tkinter.StringVar()
basePoints_Alola_hp_Entr=tkinter.Entry(basePoints_hp_Alola,width =5)
basePoints_attack_Alola=tkinter.Frame(basePointsLabel_Alola)
basePoints_Alola_attack_label=tkinter.Label(basePoints_attack_Alola,text='攻击：',width =5)
basePoints_Alola_attack=tkinter.StringVar()
basePoints_Alola_attack_Entr=tkinter.Entry(basePoints_attack_Alola,width =5)
basePoints_defense_Alola=tkinter.Frame(basePointsLabel_Alola)
basePoints_Alola_defense_label=tkinter.Label(basePoints_defense_Alola,text='防御：',width =5)
basePoints_Alola_defense=tkinter.StringVar()
basePoints_Alola_defense_Entr=tkinter.Entry(basePoints_defense_Alola,width =5)
basePoints_specialAttack_Alola=tkinter.Frame(basePointsLabel_Alola)
basePoints_Alola_specialAttack_label=tkinter.Label(basePoints_specialAttack_Alola,text='特攻：',width =5)
basePoints_Alola_specialAttack=tkinter.StringVar()
basePoints_Alola_specialAttack_Entr=tkinter.Entry(basePoints_specialAttack_Alola,width =5)
basePoints_specialDefense_Alola=tkinter.Frame(basePointsLabel_Alola)
basePoints_Alola_specialDefense_label=tkinter.Label(basePoints_specialDefense_Alola,text='特防：',width =5)
basePoints_Alola_specialDefense=tkinter.StringVar()
basePoints_Alola_specialDefense_Entr=tkinter.Entry(basePoints_specialDefense_Alola,width =5)
basePoints_speed_Alola=tkinter.Frame(basePointsLabel_Alola)
basePoints_Alola_speed_label=tkinter.Label(basePoints_speed_Alola,text='速度：')
basePoints_Alola_speed=tkinter.StringVar()
basePoints_Alola_speed_Entr=tkinter.Entry(basePoints_speed_Alola,width =5)
#阿罗拉亚种组件，测试
Data_Galar=tkinter.Frame(frame_Galar)
Sep_Galar=tkinter.ttk.Separator(frame_Galar,orient='horizontal')
frame_Galar_part_1=tkinter.Frame(Data_Galar)
frame_Galar_part_2=tkinter.Frame(Data_Galar)

pokeFormName_Galar=tkinter.Frame(frame_Galar_part_1)
pokemFormNameString_Galar=tkinter.StringVar()
pokeFormName_label_Galar=tkinter.Label(pokeFormName_Galar,text='形态别名:')
pokeFormName_littleFrame_Galar=tkinter.Frame(pokeFormName_Galar)
pokeFormName_Entr_Galar=tkinter.Entry(pokeFormName_littleFrame_Galar,width =15)

pokekind_Galar=tkinter.Frame(frame_Galar_part_1)
pokekind_label_Galar=tkinter.Label(pokekind_Galar,text='类别:')
pokekind_littleFrame_Galar=tkinter.Frame(pokekind_Galar)
pokekindString_Galar=tkinter.StringVar()
pokekind_Entr_Galar=tkinter.Entry(pokekind_littleFrame_Galar,width =12)
pokekind_label2_Galar=tkinter.Label(pokekind_littleFrame_Galar,text='宝可梦')

Type_Galar=tkinter.Frame(frame_Galar_part_1)
typeList1_Galar=tkinter.StringVar()
typeList2_Galar=tkinter.StringVar()
typeLists=['','none',*list(types.values())]
typeList1_Galar.set(typeLists[1])
typeList2_Galar.set(typeLists[1])
print(typeLists)
Type1_Galar_label=tkinter.Label(Type_Galar,text='属性1：')
Type1_Galar=tkinter.ttk.OptionMenu(Type_Galar,typeList1_Galar,*typeLists,direction='right')
Type2_Galar_label=tkinter.Label(Type_Galar,text='属性2：')
Type2_Galar=tkinter.ttk.OptionMenu(Type_Galar,typeList2_Galar,*typeLists,direction='right')

Abilities_Galar=tkinter.LabelFrame(frame_Galar_part_1,labelanchor='nw',text='特性')
Abilities_1_Galar=tkinter.Frame(Abilities_Galar)
Abilities_2_Galar=tkinter.Frame(Abilities_Galar)
Abilities_3_Galar=tkinter.Frame(Abilities_Galar)
AbilitiesList1_Galar=tkinter.StringVar()
AbilitiesList2_Galar=tkinter.StringVar()
AbilitiesList3_Galar=tkinter.StringVar()
AbilitiesLists=['none',*list(Abilities.values())]
AbilitiesList1_Galar.set(AbilitiesLists[0])
AbilitiesList2_Galar.set(AbilitiesLists[0])
AbilitiesList3_Galar.set(AbilitiesLists[0])
Abilities1_Galar_label=tkinter.Label(Abilities_1_Galar,text='特性1：',width =10)
AbilitiesMenu1_Galar=AutocompleteCombobox(Abilities_1_Galar,height=5,values=AbilitiesLists)
AbilitiesMenu1_Galar.set_completion_list(AbilitiesLists)
#AbilitiesMenu1_Galar.configure(state="readonly")
Abilities2_Galar_label=tkinter.Label(Abilities_2_Galar,text='特性2：',width =10)
AbilitiesMenu2_Galar=AutocompleteCombobox(Abilities_2_Galar,height=5,values=AbilitiesLists)
AbilitiesMenu2_Galar.set_completion_list(AbilitiesLists)
#AbilitiesMenu2_Galar.configure(state="readonly")
Abilities3_Galar_label=tkinter.Label(Abilities_3_Galar,text='隐藏特性：',width =10)
AbilitiesMenu3_Galar=AutocompleteCombobox(Abilities_3_Galar,height=5,values=AbilitiesLists)
AbilitiesMenu3_Galar.set_completion_list(AbilitiesLists)
#AbilitiesMenu3_Galar.configure(state="readonly")

Egg_Galar=tkinter.LabelFrame(frame_Galar_part_2,labelanchor='nw',text='蛋群')
Egg1_Frame_Galar=tkinter.Frame(Egg_Galar)
Egg2_Frame_Galar=tkinter.Frame(Egg_Galar)
EggList1_Galar=tkinter.StringVar()
EggList2_Galar=tkinter.StringVar()
EggLists=['','none',*list(Eggs.values())]
EggList1_Galar.set(EggLists[1])
EggList2_Galar.set(EggLists[1])
Egg1_Galar_label=tkinter.Label(Egg1_Frame_Galar,text='蛋组1：',width =5)
Egg1_Galar=tkinter.ttk.OptionMenu(Egg1_Frame_Galar,EggList1_Galar,*EggLists)
Egg2_Galar_label=tkinter.Label(Egg2_Frame_Galar,text='蛋组2：',width =5)
Egg2_Galar=tkinter.ttk.OptionMenu(Egg2_Frame_Galar,EggList2_Galar,*EggLists)

Color_Galar=tkinter.Frame(frame_Galar_part_2)
ColorList_Galar=tkinter.StringVar()
ColorLists=['','none',*list(Colors.values())]
ColorList_Galar.set(ColorLists[1])
Color_Galar_label=tkinter.Label(Color_Galar,text='颜色：',width =5)
ColorMenu_Galar=tkinter.ttk.OptionMenu(Color_Galar,ColorList_Galar,*ColorLists)

genderTatio_Galar=tkinter.Frame(frame_Galar_part_1)
genderTatioList_Galar=tkinter.StringVar()
genderTatioLists=['','none',*list(genderTatios.values())]
genderTatioList_Galar.set(genderTatioLists[1])
genderTatio_Galar_label=tkinter.Label(genderTatio_Galar,text='性别比♂:♀：')
genderTatioMenu_Galar=tkinter.ttk.OptionMenu(genderTatio_Galar,genderTatioList_Galar,*genderTatioLists)


bodilyForm_Galar=tkinter.Frame(frame_Galar_part_2)
bodilyFormList_Galar=tkinter.StringVar()
bodilyFormLists=['','none',*list(bodilyForms.values())]
bodilyFormList_Galar.set(bodilyFormLists[1])
bodilyForm_Galar_label=tkinter.Label(bodilyForm_Galar,text='体型：',width =5)
bodilyFormMenu_Galar=tkinter.ttk.OptionMenu(bodilyForm_Galar,bodilyFormList_Galar,*bodilyFormLists)

hatchRare_Galar=tkinter.Frame(frame_Galar_part_2)
hatchRareList_Galar=tkinter.StringVar()
hatchRareLists=['','none',*hatchRare]
hatchRareList_Galar.set(hatchRareLists[1])
hatchRare_Galar_label=tkinter.Label(hatchRare_Galar,text='孵化周期：',width =10)
hatchRareMenu_Galar=tkinter.ttk.OptionMenu(hatchRare_Galar,hatchRareList_Galar,*hatchRareLists)

pokedex_Galar=tkinter.Frame(frame_Galar_part_2)
pokedex_label_Galar=tkinter.Label(pokedex_Galar,text='图鉴说明:',width =10)
pokedex_text_Galar=tkinter.Text(pokedex_Galar,width =30,height=10)

startFriendship_Galar=tkinter.Frame(frame_Galar_part_2)
startFriendshipList_Galar=tkinter.StringVar()
startFriendshipLists=['','none',*startFriendship]
startFriendshipList_Galar.set(startFriendshipLists[1])
startFriendship_Galar_label=tkinter.Label(startFriendship_Galar,text='初始亲密度：')
startFriendshipMenu_Galar=tkinter.ttk.OptionMenu(startFriendship_Galar,startFriendshipList_Galar,*startFriendshipLists)

catchRare_Galar=tkinter.Frame(frame_Galar_part_1)
catchRare_Galar_str=tkinter.StringVar()
catchRare_Galar_label=tkinter.Label(catchRare_Galar,text='捕获率：')
catchRareBox_Galar=tkinter.Spinbox(catchRare_Galar,from_=3,to=255,width =5,textvariable=catchRare_Galar_str)

heightm_Galar=tkinter.Frame(frame_Galar_part_2)
heightm_Galar_str=tkinter.StringVar()
heightm_Galar_label=tkinter.Label(heightm_Galar,text='身高：')
heightmBox_Galar=tkinter.Spinbox(heightm_Galar,from_=0,to=10000,increment=0.1,width =5,textvariable=heightm_Galar_str)
heightm_Galar_labelM=tkinter.Label(heightm_Galar,text='m')

weightkg_Galar=tkinter.Frame(frame_Galar_part_2)
weightkg_Galar_str=tkinter.StringVar()
weightkg_Galar_label=tkinter.Label(weightkg_Galar,text='体重：')
weightkgBox_Galar=tkinter.Spinbox(weightkg_Galar,from_=0,to=10000,increment=0.1,width =5,textvariable=weightkg_Galar_str)
weightkg_Galar_labelKG=tkinter.Label(weightkg_Galar,text='kg')


LevelUpRare_Galar=tkinter.Frame(frame_Galar_part_1)
LevelUpRareList_Galar=tkinter.StringVar()
LevelUpRareLists=['','none',*list(LevelUpRares.values())]
LevelUpRareList_Galar.set(LevelUpRareLists[1])
LevelUpRare_Galar_label=tkinter.Label(LevelUpRare_Galar,text='升级速率：')
LevelUpRareMenu_Galar=tkinter.ttk.OptionMenu(LevelUpRare_Galar,LevelUpRareList_Galar,*LevelUpRareLists)

BallteData_Galar=tkinter.Frame(frame_Galar_part_1)
baseStatsLabel_Galar=tkinter.LabelFrame(BallteData_Galar, text="种族值", labelanchor="nw")
basePointsLabel_Galar=tkinter.LabelFrame(BallteData_Galar, text="基础点数", labelanchor="nw")

baseStats_hp_Galar=tkinter.Frame(baseStatsLabel_Galar)
baseStats_Galar_hp_label=tkinter.Label(baseStats_hp_Galar,text='HP：',width =5)
baseStats_Galar_hp=tkinter.StringVar()
baseStats_Galar_hp_Entr=tkinter.Entry(baseStats_hp_Galar,width =5)
baseStats_attack_Galar=tkinter.Frame(baseStatsLabel_Galar)
baseStats_Galar_attack_label=tkinter.Label(baseStats_attack_Galar,text='攻击：',width =5)
baseStats_Galar_attack=tkinter.StringVar()
baseStats_Galar_attack_Entr=tkinter.Entry(baseStats_attack_Galar,width =5)
baseStats_defense_Galar=tkinter.Frame(baseStatsLabel_Galar)
baseStats_Galar_defense_label=tkinter.Label(baseStats_defense_Galar,text='防御：',width =5)
baseStats_Galar_defense=tkinter.StringVar()
baseStats_Galar_defense_Entr=tkinter.Entry(baseStats_defense_Galar,width =5)
baseStats_specialAttack_Galar=tkinter.Frame(baseStatsLabel_Galar)
baseStats_Galar_specialAttack_label=tkinter.Label(baseStats_specialAttack_Galar,text='特攻：',width =5)
baseStats_Galar_specialAttack=tkinter.StringVar()
baseStats_Galar_specialAttack_Entr=tkinter.Entry(baseStats_specialAttack_Galar,width =5)
baseStats_specialDefense_Galar=tkinter.Frame(baseStatsLabel_Galar)
baseStats_Galar_specialDefense_label=tkinter.Label(baseStats_specialDefense_Galar,text='特防：',width =5)
baseStats_Galar_specialDefense=tkinter.StringVar()
baseStats_Galar_specialDefense_Entr=tkinter.Entry(baseStats_specialDefense_Galar,width =5)
baseStats_speed_Galar=tkinter.Frame(baseStatsLabel_Galar)
baseStats_Galar_speed_label=tkinter.Label(baseStats_speed_Galar,text='速度：')
baseStats_Galar_speed=tkinter.StringVar()
baseStats_Galar_speed_Entr=tkinter.Entry(baseStats_speed_Galar,width =5)

basePoints_hp_Galar=tkinter.Frame(basePointsLabel_Galar)
basePoints_Galar_hp_label=tkinter.Label(basePoints_hp_Galar,text='HP：',width =5)
basePoints_Galar_hp=tkinter.StringVar()
basePoints_Galar_hp_Entr=tkinter.Entry(basePoints_hp_Galar,width =5)
basePoints_attack_Galar=tkinter.Frame(basePointsLabel_Galar)
basePoints_Galar_attack_label=tkinter.Label(basePoints_attack_Galar,text='攻击：',width =5)
basePoints_Galar_attack=tkinter.StringVar()
basePoints_Galar_attack_Entr=tkinter.Entry(basePoints_attack_Galar,width =5)
basePoints_defense_Galar=tkinter.Frame(basePointsLabel_Galar)
basePoints_Galar_defense_label=tkinter.Label(basePoints_defense_Galar,text='防御：',width =5)
basePoints_Galar_defense=tkinter.StringVar()
basePoints_Galar_defense_Entr=tkinter.Entry(basePoints_defense_Galar,width =5)
basePoints_specialAttack_Galar=tkinter.Frame(basePointsLabel_Galar)
basePoints_Galar_specialAttack_label=tkinter.Label(basePoints_specialAttack_Galar,text='特攻：',width =5)
basePoints_Galar_specialAttack=tkinter.StringVar()
basePoints_Galar_specialAttack_Entr=tkinter.Entry(basePoints_specialAttack_Galar,width =5)
basePoints_specialDefense_Galar=tkinter.Frame(basePointsLabel_Galar)
basePoints_Galar_specialDefense_label=tkinter.Label(basePoints_specialDefense_Galar,text='特防：',width =5)
basePoints_Galar_specialDefense=tkinter.StringVar()
basePoints_Galar_specialDefense_Entr=tkinter.Entry(basePoints_specialDefense_Galar,width =5)
basePoints_speed_Galar=tkinter.Frame(basePointsLabel_Galar)
basePoints_Galar_speed_label=tkinter.Label(basePoints_speed_Galar,text='速度：')
basePoints_Galar_speed=tkinter.StringVar()
basePoints_Galar_speed_Entr=tkinter.Entry(basePoints_speed_Galar,width =5)
#伽勒尔地区上线中

Data_Notebook.add(frame_Normal, text='原始物种')
Data_Notebook.add(frame_Alola, text='阿罗拉亚种')
Data_Notebook.add(frame_Galar, text='伽勒尔亚种')
DataFrame = tkinter.Frame(frame_Normal)
SaveButton = tkinter.Button(DataFrame, text='保存',command=save)

DataFrame_Alola = tkinter.Frame(frame_Alola)
SaveButton_Alola = tkinter.Button(DataFrame_Alola, text='保存',command=save)

DataFrame_Galar = tkinter.Frame(frame_Galar)
SaveButton_Galar = tkinter.Button(DataFrame_Galar, text='保存',command=save)
#top.geometry('150x0')
#button_create=tkinter.Button(top,text='新建世代',command=createGenList).pack()
#多级菜单尝试，有现成方法，但是不美观
menubar=tkinter.Menu(top)
listBox_poke=tkinter.Listbox(top,width=40)
scroll = tkinter.Scrollbar(top)
Data_Notebook.event_generate('<<NotebookTabChanged>>')
now_gen='未知'#此时查看的世代名
check_num=0#此时查看的编号
menubar.add_command(label='新建世代',command=createGenList)
minMenu = tkinter.Menu(menubar, tearoff=0,postcommand=update)
menubar.add_cascade(label='选择世代',menu=minMenu)
KeyMimMenu=tkinter.Menu(menubar,tearoff=0,postcommand=update_key)
menubar.add_cascade(label='资源子项添加',menu=KeyMimMenu)
FormKeyMimNenu=tkinter.Menu(menubar,tearoff=0,postcommand=update_formKey)
menubar.add_command(label='资源项添加',command=update_res)
menubar.add_cascade(label='样子差异添加',menu=FormKeyMimNenu)
top.config(menu=menubar)
#下拉菜单尝试，难做反馈
#var = tkinter.StringVar()
#if get_gen_list()==[]:
#    var.set("未新建世代")
#    tkinter.OptionMenu(top, var, '请新建').pack()
#else:
 #   var.set("请选择世代")
 #   tkinter.OptionMenu(top, var, *get_gen_list()).pack()
top.mainloop()
